Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 9e99aad

Browse files
feat(task): Ignore error log when user aborts during installation (#42)
When hitting <kbd>Ctrl</kbd> <kbd>C</kbd> (sending the signal `SIGINT`), it is unnecessary and counter-intuitive to log the error during the installation step.
1 parent b731cf8 commit 9e99aad

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

packages/tasks/node/install.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,21 @@ module.exports = function install(config) {
2121
} catch (err) {
2222
logger.log();
2323
logger.log();
24-
logger.error(chalk.red('📦 Dependencies could not be installed.'));
25-
logger.log(err);
26-
logger.log();
27-
logger.log('Try to create the app without installing the dependencies:');
28-
logger.log(
29-
` ${chalk.cyan('create-instantsearch-app')} ${process.argv
30-
.slice(2)
31-
.join(' ')} --no-installation`
32-
);
3324

34-
logger.log();
25+
if (err.signal !== 'SIGINT') {
26+
logger.error(chalk.red('📦 Dependencies could not be installed.'));
27+
28+
logger.log(err);
29+
logger.log();
30+
logger.log('Try to create the app without installing the dependencies:');
31+
logger.log(
32+
` ${chalk.cyan('create-instantsearch-app')} ${process.argv
33+
.slice(2)
34+
.join(' ')} --no-installation`
35+
);
36+
logger.log();
37+
}
38+
3539
logger.log();
3640
logger.error(chalk.red('🛑 Aborting the app generation.'));
3741
logger.log();

0 commit comments

Comments
 (0)