-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(setup): add
--dry-run
flag (#492)
* add dry-fun flag for setup step * add help message for --dry-run option * fix: update test snapshot
- Loading branch information
Showing
7 changed files
with
50 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ export default ({ | |
scheduleCircleCI, | ||
cronExpr, | ||
dir, | ||
dryRun, | ||
}) => | ||
runStep( | ||
{ | ||
|
@@ -42,8 +43,13 @@ export default ({ | |
gitUserName: getGitConfig('user.name') || 'Your Name', | ||
gitUserEmail: getGitConfig('user.email') || '[email protected]', | ||
}); | ||
mkdirp.sync(path.dirname(filePath)); | ||
fs.writeFileSync(filePath, content); | ||
if (dryRun) { | ||
print(`.circleci/config.yml`); | ||
print(content); | ||
} else { | ||
mkdirp.sync(path.dirname(filePath)); | ||
fs.writeFileSync(filePath, content); | ||
} | ||
return () => { | ||
print(`${info('✔')} Created \`.circleci/config.yml\`.`); | ||
print(' You still need to finish setting up at CircleCI.'); | ||
|
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