-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add license url and name auto detection
- Loading branch information
Franck
committed
Jun 8, 2019
1 parent
9924f72
commit d2ee432
Showing
7 changed files
with
77 additions
and
32 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
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,6 @@ | ||
module.exports = packageJson => ({ | ||
type: 'input', | ||
message: '🔒 License name (use empty value to skip)', | ||
name: 'licenseName', | ||
default: packageJson.licenseName | ||
}) |
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
module.exports = () => ({ | ||
type: 'input', | ||
message: '🔒 License url (use empty value to skip)', | ||
name: 'licenseUrl' | ||
}) | ||
const isEmpty = require('lodash/isEmpty') | ||
|
||
module.exports = (projectInfos, answersContext) => | ||
isEmpty(answersContext.licenseName) | ||
? undefined | ||
: { | ||
type: 'input', | ||
message: '🔒 License url (use empty value to skip)', | ||
name: 'licenseUrl', | ||
default: projectInfos.licenseUrl | ||
} |
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