Skip to content

Commit

Permalink
Implementing remotemobprogramming#266 - Being able to trigger tests o…
Browse files Browse the repository at this point in the history
…n mob start
  • Loading branch information
MrGung committed Jul 30, 2022
1 parent b747477 commit 1595d50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ MOB_GIT_HOOKS_ENABLED=false
MOB_REQUIRE_COMMIT_MESSAGE=false
MOB_VOICE_COMMAND="say \"%s\""
MOB_VOICE_MESSAGE="mob next"
MOB_START_HOOK=""
MOB_NOTIFY_COMMAND="/usr/bin/osascript -e 'display notification \"%s\"'"
MOB_NOTIFY_MESSAGE="mob next"
MOB_NEXT_STAY=true
Expand Down
8 changes: 8 additions & 0 deletions mob.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type Configuration struct {
RequireCommitMessage bool // override with MOB_REQUIRE_COMMIT_MESSAGE
VoiceCommand string // override with MOB_VOICE_COMMAND
VoiceMessage string // override with MOB_VOICE_MESSAGE
StartHook string // override with MOB_START_HOOK
NotifyCommand string // override with MOB_NOTIFY_COMMAND
NotifyMessage string // override with MOB_NOTIFY_MESSAGE
NextStay bool // override with MOB_NEXT_STAY
Expand Down Expand Up @@ -311,6 +312,7 @@ func getDefaultConfiguration() Configuration {
GitHooksEnabled: false,
VoiceCommand: voiceCommand,
VoiceMessage: "mob next",
StartHook: "",
NotifyCommand: notifyCommand,
NotifyMessage: "mob next",
NextStay: true,
Expand Down Expand Up @@ -382,6 +384,8 @@ func parseUserConfiguration(configuration Configuration, path string) Configurat
setUnquotedString(&configuration.VoiceCommand, key, value)
case "MOB_VOICE_MESSAGE":
setUnquotedString(&configuration.VoiceMessage, key, value)
case "MOB_START_HOOK":
setUnquotedString(&configuration.StartHook, key, value)
case "MOB_NOTIFY_COMMAND":
setUnquotedString(&configuration.NotifyCommand, key, value)
case "MOB_NOTIFY_MESSAGE":
Expand Down Expand Up @@ -555,6 +559,7 @@ func parseEnvironmentVariables(configuration Configuration) Configuration {
setBoolFromEnvVariable(&configuration.RequireCommitMessage, "MOB_REQUIRE_COMMIT_MESSAGE")
setOptionalStringFromEnvVariable(&configuration.VoiceCommand, "MOB_VOICE_COMMAND")
setStringFromEnvVariable(&configuration.VoiceMessage, "MOB_VOICE_MESSAGE")
setOptionalStringFromEnvVariable(&configuration.StartHook, "MOB_START_HOOK")
setOptionalStringFromEnvVariable(&configuration.NotifyCommand, "MOB_NOTIFY_COMMAND")
setStringFromEnvVariable(&configuration.NotifyMessage, "MOB_NOTIFY_MESSAGE")
setStringFromEnvVariable(&configuration.WipBranchQualifierSeparator, "MOB_WIP_BRANCH_QUALIFIER_SEPARATOR")
Expand Down Expand Up @@ -672,6 +677,7 @@ func config(c Configuration) {
say("MOB_REQUIRE_COMMIT_MESSAGE" + "=" + strconv.FormatBool(c.RequireCommitMessage))
say("MOB_VOICE_COMMAND" + "=" + quote(c.VoiceCommand))
say("MOB_VOICE_MESSAGE" + "=" + quote(c.VoiceMessage))
say("MOB_START_HOOK" + "=" + quote(c.StartHook))
say("MOB_NOTIFY_COMMAND" + "=" + quote(c.NotifyCommand))
say("MOB_NOTIFY_MESSAGE" + "=" + quote(c.NotifyMessage))
say("MOB_NEXT_STAY" + "=" + strconv.FormatBool(c.NextStay))
Expand Down Expand Up @@ -1175,6 +1181,8 @@ func start(configuration Configuration) error {

openLastModifiedFileIfPresent(configuration)

executeStartHook()

return nil // no error
}

Expand Down

0 comments on commit 1595d50

Please sign in to comment.