-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(contribute): add initial resources
- Loading branch information
1 parent
33060fd
commit ad9b4c8
Showing
6 changed files
with
1,202 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
var path = require('path') | ||
var assert = require('yeoman-assert') | ||
var helpers = require('yeoman-test') | ||
|
||
describe('generator-community:contribute', () => { | ||
beforeAll(() => { | ||
return helpers.run(path.join(__dirname, '../generators/contribute')) | ||
.withPrompts({someAnswer: true}) | ||
}) | ||
|
||
it('creates files', () => { | ||
assert.file([ | ||
'CONTRIBUTING.md' | ||
]) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict' | ||
const Generator = require('yeoman-generator') | ||
|
||
module.exports = class extends Generator { | ||
prompting () { | ||
const prompts = [{ | ||
type: 'confirm', | ||
name: 'someAnswer', | ||
message: 'Would you like to enable this option?', | ||
default: true | ||
}] | ||
|
||
return this.prompt(prompts).then((props) => { | ||
// To access props later use this.props.someAnswer; | ||
this.props = props | ||
}) | ||
} | ||
|
||
writing () { | ||
this.fs.copy( | ||
this.templatePath('_CONTRIBUTING.md'), | ||
this.destinationPath('CONTRIBUTING.md') | ||
) | ||
} | ||
} |
Oops, something went wrong.