Skip to content

Commit

Permalink
fix: rename showProjectTips to showSuccessTips
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 7, 2019
1 parent de6b127 commit b11c1ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ yarn add kopy
const kopy = require('kopy')

const config = {
// Ask some questions!
prompts() {
return [
{
Expand All @@ -23,19 +24,25 @@ const config = {
}
]
},
// Manipulate files with ease!
actions() {
return [
// Copy files from `templates` directory to output directory
{
type: 'copy',
// One or more glob patterns
files: '**',
cwd: '/path/to/templates',
// When specified, transform the files with `ejs`
data: this.answers
}
]
},
// When we're done :)
completed() {
console.log('Done!')
this.logger.success(`Generated into ${this.colors.underline(this.outDir)}`)
// Or simply:
// this.showSuccessTips()
}
}

Expand All @@ -56,6 +63,7 @@ const kopy = require('kopy')
test('it works', async () => {
const generator = kopy(config)
const result = await generator.test({
// Prompt answers
name: 'kevin'
})
expect(result.fileList).toContain('index.js')
Expand Down
2 changes: 1 addition & 1 deletion example/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ module.exports = {
async completed() {
await this.npmInstall()
await this.gitInit({ commit: true })
this.logger.success('Done!')
this.showSuccessTips()
}
}
2 changes: 1 addition & 1 deletion lib/Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ module.exports = class Generator {
return fs.readFileSync(path.join(this.outDir, file), 'utf8')
}

showProjectTips() {
showSuccessTips() {
spinner.stop() // Stop when necessary
logger.success(`Generated into ${this.colors.underline(this.outDir)}`)
}
Expand Down

0 comments on commit b11c1ea

Please sign in to comment.