summaryrefslogtreecommitdiff
path: root/mode.go
diff options
context:
space:
mode:
Diffstat (limited to 'mode.go')
-rw-r--r--mode.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/mode.go b/mode.go
index 21976fb..3711f9a 100644
--- a/mode.go
+++ b/mode.go
@@ -2,6 +2,12 @@
package forgepb
+import (
+ "fmt"
+
+ "go.wit.com/lib/env"
+)
+
// TODO: implement i18n with the protobuf's
func (f *Forge) GetMode() string {
switch f.mode {
@@ -16,6 +22,31 @@ func (f *Forge) GetMode() string {
}
}
+func getModeENV() ForgeMode {
+ // always set f.mode // todo: do something else besides this ?
+ switch env.Get("Mode") {
+ case "NORMAL":
+ return ForgeMode_NORMAL
+ case "CUSTOM":
+ return ForgeMode_CUSTOM
+ case "GOLANG":
+ return ForgeMode_GOLANG
+ case "CLEAN":
+ return ForgeMode_CLEAN
+ case "MASTER":
+ return ForgeMode_MASTER
+ case "DEVEL":
+ return ForgeMode_DEVEL
+ case "USER":
+ return ForgeMode_USER
+ case "NEWUSER":
+ return ForgeMode_NEWUSER
+ default:
+ fmt.Printf("MODE ERROR (%s)\n", env.Get("Mode"))
+ }
+ return ForgeMode_NEWUSER
+}
+
// indicates the user is trying to cleanup repos
// stays in this mode until the user leaves it
// should not change the repos selected