MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / parseEnvironmentVariables

Function parseEnvironmentVariables

configuration/configuration.go:428–476  ·  view source on GitHub ↗
(configuration Configuration)

Source from the content-addressed store, hash-verified

426}
427
428func parseEnvironmentVariables(configuration Configuration) Configuration {
429 setStringFromEnvVariable(&configuration.CliName, "MOB_CLI_NAME")
430 if configuration.CliName != GetDefaultConfiguration().CliName {
431 configuration.WipCommitMessage = configuration.CliName + " next [ci-skip] [ci skip] [skip ci]"
432 configuration.VoiceMessage = configuration.CliName + " next"
433 configuration.NotifyMessage = configuration.CliName + " next"
434 }
435
436 removed("MOB_BASE_BRANCH", "Use '"+configuration.Mob("start")+"' on your base branch instead.")
437 removed("MOB_WIP_BRANCH", "Use '"+configuration.Mob("start --branch <branch>")+"' instead.")
438 removed("MOB_START_INCLUDE_UNCOMMITTED_CHANGES", "Use the parameter --include-uncommitted-changes instead.")
439 experimental("MOB_WIP_BRANCH_PREFIX")
440 deprecated("MOB_START_COMMIT_MESSAGE", "Please check that everybody you work with uses version 5.0.0 or higher. Then this environment variable can be unset, as it will not have an impact anymore.")
441
442 setStringFromEnvVariable(&configuration.RemoteName, "MOB_REMOTE_NAME")
443 setStringFromEnvVariable(&configuration.WipCommitMessage, "MOB_WIP_COMMIT_MESSAGE")
444 setStringFromEnvVariable(&configuration.StartCommitMessage, "MOB_START_COMMIT_MESSAGE")
445 setBoolFromEnvVariable(&configuration.SkipCiPushOptionEnabled, "MOB_SKIP_CI_PUSH_OPTION_ENABLED")
446 setBoolFromEnvVariable(&configuration.GitHooksEnabled, "MOB_GIT_HOOKS_ENABLED")
447 setBoolFromEnvVariable(&configuration.RequireCommitMessage, "MOB_REQUIRE_COMMIT_MESSAGE")
448 setOptionalStringFromEnvVariable(&configuration.VoiceCommand, "MOB_VOICE_COMMAND")
449 setStringFromEnvVariable(&configuration.VoiceMessage, "MOB_VOICE_MESSAGE")
450 setOptionalStringFromEnvVariable(&configuration.NotifyCommand, "MOB_NOTIFY_COMMAND")
451 setStringFromEnvVariable(&configuration.NotifyMessage, "MOB_NOTIFY_MESSAGE")
452 setStringFromEnvVariable(&configuration.WipBranchQualifierSeparator, "MOB_WIP_BRANCH_QUALIFIER_SEPARATOR")
453
454 setStringFromEnvVariable(&configuration.WipBranchQualifier, "MOB_WIP_BRANCH_QUALIFIER")
455 setStringFromEnvVariable(&configuration.WipBranchPrefix, "MOB_WIP_BRANCH_PREFIX")
456
457 setBoolFromEnvVariable(&configuration.NextStay, "MOB_NEXT_STAY")
458
459 setBoolFromEnvVariable(&configuration.StartCreate, "MOB_START_CREATE")
460
461 setDoneSquashFromEnvVariable(&configuration, "MOB_DONE_SQUASH")
462
463 setStringFromEnvVariable(&configuration.OpenCommand, "MOB_OPEN_COMMAND")
464
465 setStringFromEnvVariable(&configuration.Timer, "MOB_TIMER")
466 setStringFromEnvVariable(&configuration.TimerRoom, "MOB_TIMER_ROOM")
467 setBoolFromEnvVariable(&configuration.TimerRoomUseWipBranchQualifier, "MOB_TIMER_ROOM_USE_WIP_BRANCH_QUALIFIER")
468 setBoolFromEnvVariable(&configuration.TimerLocal, "MOB_TIMER_LOCAL")
469 setStringFromEnvVariable(&configuration.TimerUser, "MOB_TIMER_USER")
470 setStringFromEnvVariable(&configuration.TimerUrl, "MOB_TIMER_URL")
471 setBoolFromEnvVariable(&configuration.TimerInsecure, "MOB_TIMER_INSECURE")
472
473 setBoolFromEnvVariable(&configuration.ResetDeleteRemoteWipBranch, "MOB_RESET_DELETE_REMOTE_WIP_BRANCH")
474
475 return configuration
476}
477
478func setStringFromEnvVariable(s *string, key string) {
479 value, set := os.LookupEnv(key)

Callers 3

setEnvVarAndParseFunction · 0.85
ReadConfigurationFunction · 0.85

Calls 9

setStringFromEnvVariableFunction · 0.85
GetDefaultConfigurationFunction · 0.85
removedFunction · 0.85
experimentalFunction · 0.85
deprecatedFunction · 0.85
setBoolFromEnvVariableFunction · 0.85
MobMethod · 0.80

Tested by 2

setEnvVarAndParseFunction · 0.68