-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from phase2/develop
Release 2.1.3
- Loading branch information
Showing
13 changed files
with
280 additions
and
61 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,50 @@ | ||
package commands | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
// Dev is the command for setting docker config to talk to a Docker Machine | ||
type Dev struct { | ||
BaseCommand | ||
} | ||
|
||
// Commands returns the operations supported by this command | ||
func (cmd *Dev) Commands() []cli.Command { | ||
return []cli.Command{ | ||
{ | ||
Name: "dev:win", | ||
Usage: "A no-op command that will always succeed.", | ||
Before: cmd.Before, | ||
Action: cmd.RunSucceed, | ||
Hidden: true, | ||
}, | ||
{ | ||
Name: "dev:fail", | ||
Usage: "A no-op command that will always fail.", | ||
Before: cmd.Before, | ||
Action: cmd.RunFail, | ||
Hidden: true, | ||
}, | ||
} | ||
} | ||
|
||
// RunSucceed executes the `rig dev:succeed` command | ||
func (cmd *Dev) RunSucceed(c *cli.Context) error { | ||
cmd.out.Spin("Think positive...") | ||
time.Sleep(3 * time.Second) | ||
cmd.out.Info("We've got it.") | ||
return cmd.Success("Positively successful!") | ||
} | ||
|
||
// RunFail executes the `rig dev:fail` command | ||
func (cmd *Dev) RunFail(c *cli.Context) error { | ||
cmd.out.Spin("Abandon all hope...") | ||
time.Sleep(3 * time.Second) | ||
cmd.out.Warning("Hope slipping...") | ||
cmd.out.Spin("Is the sky painted black?") | ||
time.Sleep(3 * time.Second) | ||
return cmd.Failure("Hope abandoned :(", "ABANDON-HOPE", 418) | ||
} |
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
Oops, something went wrong.