Skip to content

Commit

Permalink
feat: add spinner for long running task (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Albert Yu <dev.yufan@gmail.com> (+1 squashed commit)
Squashed commits:
[19c08c1] Lock down version 0.2.1 for ora

Signed-off-by: Albert Yu <dev.yufan@gmail.com> (+1 squashed commit)
Squashed commits:
[68af375] Add spinner for long-running task

Signed-off-by: Albert <dev.yufan@gmail.com>
  • Loading branch information
nightire authored and zacharygolba committed Apr 20, 2016
1 parent 03958b9 commit 30ca0c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"gulp-babel": "6.1.2",
"gulp-eslint": "2.0.0",
"gulp-uglify": "1.5.3",
"mysql": "2.10.2"
"mysql": "2.10.2",
"ora": "0.2.1"
}
}
11 changes: 10 additions & 1 deletion src/packages/cli/commands/create.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Ora from 'ora';
import Promise from 'bluebird';
import { green } from 'colors/safe';

Expand Down Expand Up @@ -134,9 +135,17 @@ ${green('create')} .gitignore
});

console.log(`${green('initialize')} git`);
console.log('Installing dependencies from npm...');

const spinner = new Ora({
text: 'Installing dependencies from npm...',
spinner: 'dots'
});

spinner.start();

await exec('npm install', {
cwd: project
});

spinner.stop();
}

0 comments on commit 30ca0c2

Please sign in to comment.