diff options
| -rw-r--r-- | forgeConfig.proto | 8 | ||||
| -rw-r--r-- | mode.go | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/forgeConfig.proto b/forgeConfig.proto index b57b627..78dd5c3 100644 --- a/forgeConfig.proto +++ b/forgeConfig.proto @@ -36,6 +36,13 @@ message ForgeConfig { // `autogenpb:nom string goSrc = 13; // is ~/go/src unless a go.work file is found } +// todo: fix autogenpb to look for enum +enum ForgeMode { + MASTER = 0; // "release mode" + DEVEL = 1; // "patch mode" + USER = 2; // "work mode" +} + message ForgeConfigs { // `autogenpb:marshal` `autogenpb:nomutex` string uuid = 1; // `autogenpb:uuid:1941cd4f-1cfd-4bf6-aa75-c2c391907e81` string version = 2; // `autogenpb:version:v0.0.47` @@ -44,4 +51,5 @@ message ForgeConfigs { // `autogenpb:mar string xterm = 5; // what xterm the user wants as the default repeated string xtermArgv = 6; // the argv line for xterm string defaultGui = 7; // default GUI plugin to use + ForgeMode mode = 8; // what "mode" forge is in } @@ -0,0 +1,17 @@ +// Copyright 1994-2025 WIT.COM Inc Licensed GPL 3.0 + +package forgepb + +// TODO: implement i18n with the protobuf's +func (f *Forge) GetMode() string { + switch f.Config.Mode { + case ForgeMode_MASTER: + return "Release Mode (master branches)" + case ForgeMode_DEVEL: + return "Devel/Patch Mode (devel branches)" + case ForgeMode_USER: + return "Hack Mode (user branches)" + default: + return f.Config.Mode.String() + } +} |
