-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy,restart): handle exit-on option to end deployment logs
- Loading branch information
1 parent
521755c
commit f2e1981
Showing
7 changed files
with
78 additions
and
15 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
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,24 @@ | ||
'use strict'; | ||
|
||
const colors = require('colors/safe'); | ||
const Logger = require('../logger.js'); | ||
|
||
function get (follow, exitOnDeploy) { | ||
if (follow) { | ||
if (exitOnDeploy === 'deploy-start') { | ||
throw new Error('The `follow` and `exit-on` set to "deploy-start" options are not compatible'); | ||
} | ||
Logger.println(colors.yellow('The `follow` option is deprecated and will be removed in an upcoming major, use --exit-on set to "never" instead')); | ||
return 'never'; | ||
} | ||
return exitOnDeploy; | ||
} | ||
|
||
// plotQuietWarning: If in quiet mode and exitStrategy set to never plot a warning to indicate that the command will end | ||
function plotQuietWarning (exitStrategy, quiet) { | ||
if (exitStrategy === 'never' && quiet) { | ||
Logger.println(colors.bold.yellow('The "never" exit-on strategy is not compatible with the "quiet" mode, it will exit once the deployment ends')); | ||
} | ||
} | ||
|
||
module.exports = { get, plotQuietWarning }; |
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