Skip to content

Commit

Permalink
implement spinner using ora, add option to not map action type names
Browse files Browse the repository at this point in the history
  • Loading branch information
amwmedia committed Dec 14, 2018
1 parent b827766 commit 37729ca
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 690 deletions.
10 changes: 6 additions & 4 deletions example/plopfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function (plop) {
});

const delayLog = msg => answers => new Promise((resolve) => {
setTimeout(() => resolve(msg), 2000);
setTimeout(() => resolve(msg), 1000);
});

// setGenerator creates a generator that can be run with "plop generatorName"
Expand Down Expand Up @@ -71,15 +71,17 @@ module.exports = function (plop) {
}
],
actions: [
`this is a comment`,
'this is another comment',
delayLog('delayed thing'),
delayLog('another delayed thing'),
delayLog('this was also delayed'),
{
type: 'add',
path: 'folder/{{dashCase name}}.txt',
templateFile: 'templates/temp.txt',
abortOnFail: true
},
`this is a comment`,
'this is another comment',
delayLog('delayed successful thing'),
function customAction(answers) {
// move the current working directory to the plop file path
// this allows this action to work even when the generator is
Expand Down
Loading

0 comments on commit 37729ca

Please sign in to comment.