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

Commit 962af76

Browse files
committed
Adds spinner to show progress.
Fixes #6
1 parent ffef852 commit 962af76

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"dependencies": {
3030
"inquirer": "^6.2.2",
31+
"ora": "^3.2.0",
3132
"pkg-install": "^1.0.0",
3233
"yargs": "^12.0.5"
3334
},

src/create-twilio-function.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
const {
1010
installDependencies
1111
} = require('./create-twilio-function/install-dependencies');
12+
const ora = require('ora');
1213

1314
async function createTwilioFunction(config) {
1415
const projectDir = `${config.path}/${config.name}`;
@@ -19,6 +20,7 @@ async function createTwilioFunction(config) {
1920
config = { ...accountDetails, ...config };
2021

2122
// Scaffold project
23+
const spinner = ora('Creating project directories and files').start();
2224
await createDirectory(projectDir, 'functions');
2325
await createDirectory(projectDir, 'assets');
2426
await createEnvFile(projectDir, {
@@ -28,9 +30,12 @@ async function createTwilioFunction(config) {
2830
await createGitignore(projectDir);
2931
await createExampleFunction(`${projectDir}/functions`);
3032
await createPackageJSON(projectDir, config.name);
33+
spinner.succeed();
3134

3235
// Install dependencies with npm
36+
spinner.start('Installing dependencies');
3337
await installDependencies(projectDir);
38+
spinner.succeed();
3439
} catch (e) {
3540
console.log(
3641
`A directory called '${

0 commit comments

Comments
 (0)