• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-package-generator / 983

pending completion
983

cron

travis-ci-com

web-flow
Merge pull request #134 from ckeditor/ci/2269

Internal: Use `ckeditor5-dev-ci-notify-travis-status` script from new package `ckeditor5-dev-ci`.

111 of 111 branches covered (100.0%)

Branch coverage included in aggregate %.

412 of 412 relevant lines covered (100.0%)

8.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/packages/ckeditor5-package-generator/lib/utils/create-directory.js
1
/**
2
 * @license Copyright (c) 2020-2022, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
'use strict';
7

8
const chalk = require( 'chalk' );
5✔
9
const fs = require( 'fs' );
5✔
10
const mkdirp = require( 'mkdirp' );
5✔
11
const path = require( 'path' );
5✔
12

13
/**
14
 * Checks whether its possible to create a directory, and either creates it or ends the process with an error.
15
 *
16
 * @param {Logger} logger
17
 * @param {String} packageName
18
 */
19
module.exports = function createDirectory( logger, packageName ) {
5✔
20
        const directoryName = packageName.split( '/' )[ 1 ];
4✔
21
        const directoryPath = path.resolve( directoryName );
4✔
22

23
        logger.process( `Checking whether the "${ chalk.cyan( directoryName ) }" directory can be created.` );
4✔
24

25
        if ( fs.existsSync( directoryPath ) ) {
4✔
26
                logger.error( 'Cannot create a directory as the location is already taken.' );
1✔
27
                logger.error( 'Aborting.' );
1✔
28

29
                process.exit( 1 );
1✔
30
        }
31

32
        logger.process( `Creating the directory "${ chalk.cyan( directoryPath ) }".` );
4✔
33

34
        mkdirp.sync( directoryPath );
4✔
35

36
        return { directoryName, directoryPath };
4✔
37
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc