|
1 |
| -var rimraf = require('rimraf'); |
2 |
| -var chalk = require('chalk'); |
3 |
| -var replace = require("replace"); |
4 |
| -var prompt = require("prompt"); |
| 1 | +import rimraf from 'rimraf'; |
| 2 | +import {chalkSuccess, chalkProcessing} from '../chalkConfig'; |
| 3 | +import replace from 'replace'; |
| 4 | +import prompt from 'prompt'; |
| 5 | +import prompts from './setupPrompts'; |
5 | 6 |
|
6 |
| -var prompts = require('./setupPrompts'); |
| 7 | +/* eslint-disable no-console */ |
7 | 8 |
|
8 |
| -console.log(chalk.green('Dependencies installed.')); |
| 9 | +console.log(chalkSuccess('Dependencies installed.')); |
9 | 10 |
|
10 | 11 | // remove the original git repository
|
11 | 12 | rimraf('.git', error => {
|
12 | 13 | if (error) throw new Error(error);
|
13 | 14 | });
|
14 |
| -console.log(chalk.green('Original Git repository removed.\n')); |
| 15 | +console.log(chalkSuccess('Original Git repository removed.\n')); |
15 | 16 |
|
16 | 17 | // prompt the user for updates to package.json
|
17 |
| -console.log(chalk.blue('Updating package.json settings:')); |
| 18 | +console.log(chalkProcessing('Updating package.json settings:')); |
18 | 19 | prompt.start();
|
19 | 20 | prompt.get(prompts, function(err, result) {
|
20 | 21 | // parse user responses
|
21 |
| - // (default values provided for fields that will cause npm to complain if left empty) |
22 |
| - var responses = [ |
| 22 | + // default values provided for fields that will cause npm to complain if left empty |
| 23 | + const responses = [ |
23 | 24 | {
|
24 | 25 | key: 'name',
|
25 | 26 | value: result.projectName || 'new-project'
|
@@ -54,12 +55,12 @@ prompt.get(prompts, function(err, result) {
|
54 | 55 | replacement: `$1: "${res.value}"`,
|
55 | 56 | paths: ['package.json'],
|
56 | 57 | recursive: false,
|
57 |
| - silent: true, |
| 58 | + silent: true |
58 | 59 | });
|
59 |
| - }) |
| 60 | + }); |
60 | 61 |
|
61 | 62 | // remove all setup scripts from the 'tools' folder
|
62 |
| - console.log(chalk.green('\nSetup complete! Cleaning up...\n')); |
| 63 | + console.log(chalkSuccess('\nSetup complete! Cleaning up...\n')); |
63 | 64 | rimraf('./tools/setup', error => {
|
64 | 65 | if (error) throw new Error(error);
|
65 | 66 | });
|
|
0 commit comments