Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 1, 2017
1 parent 929160c commit 6d968a1
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) EGOIST <[email protected]> (github.com/egoist)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
15 changes: 12 additions & 3 deletions sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const superb = require('superb')
module.exports = {
prompts: {
name: {
message: 'What is the name of the new template?',
message: 'What is the name of the new template (better be template-*)?',
role: 'folder:name',
filter: val => val.toLowerCase()
},
Expand All @@ -14,11 +14,20 @@ module.exports = {
username: {
message: 'What is your GitHub username?',
role: 'git:name',
filter: val => val.toLowerCase()
filter: val => val.toLowerCase(),
store: true
},
email: {
message: 'What is your GitHub email?',
role: 'git:email'
role: 'git:email',
store: true
},
website: {
message: 'The URL of your website?',
default({username}) {
return `github.com/${username}`
},
store: true
}
},
skipInterpolation: [
Expand Down
1 change: 1 addition & 0 deletions template/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
21 changes: 21 additions & 0 deletions template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <%= username %> <<%= email %>> (<%= website %>)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 1 addition & 1 deletion template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ sao <%= name.replace('template-', '') %>

## License

MIT &copy; <%= username %>
MIT &copy; [<%= username %>](<%= website %>)
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "<%= username %>/<%= name %>",
"type": "git"
},
"author": "<%= username %> <<%= email %>>",
"author": "<%= username %> <<%= email %>> (<%= website %>)",
"license": "MIT",
"files": [
"sao.js",
Expand Down
21 changes: 14 additions & 7 deletions template/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ module.exports = {
},
username: {
message: 'What is your GitHub username?',
role: 'git:name'
role: 'git:name',
store: true
},
email: {
message: 'What is your GitHub email?',
role: 'git:email'
role: 'git:email',
store: true
},
website: {
message: 'The URL of your website?',
default({username}) {
return `github.com/${username}`
},
store: true
}
},
post({chalk, isNewFolder, folderName}) {
console.log(`\n ${chalk.green('done!')}`)
post({log, chalk, isNewFolder, folderName}) {
log.success('Done!')
if (isNewFolder) {
console.log(` cd ${chalk.yellow(folderName)} to get started!\n`)
} else {
console.log()
log.info(`cd ${chalk.yellow(folderName)} to get started!`)
}
}
}
12 changes: 12 additions & 0 deletions template/template/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions template/template/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
21 changes: 21 additions & 0 deletions template/template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <%= username %> <<%= email %>> (<%= website %>)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

0 comments on commit 6d968a1

Please sign in to comment.