summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-02-25 23:26:48 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-25 22:26:48 +0000
commit55300cbd7395daa7db4d4393a2b990e7b986af53 (patch)
tree97953fefe67e14d31a96de62840dfa48e3f27510
parent[chore] Update vscode launch configuration (#1556) (diff)
downloadgotosocial-55300cbd7395daa7db4d4393a2b990e7b986af53.tar.xz
[chore] Inform user on how to get testrig (#1557)
This adds a dummy testrig subcommand when we're not building with DEBUG set. Now any invocation of gotosocial testrig, plain or with any kind of subcommands or arguments will result in that error message getting returned.
-rw-r--r--cmd/gotosocial/main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/gotosocial/main.go b/cmd/gotosocial/main.go
index e3af77548..0fd354de9 100644
--- a/cmd/gotosocial/main.go
+++ b/cmd/gotosocial/main.go
@@ -20,6 +20,7 @@ package main
import (
"log"
+ "os"
godebug "runtime/debug"
"strings"
@@ -66,6 +67,8 @@ func main() {
if debug.DEBUG {
// only add testrig if debug enabled.
rootCmd.AddCommand(testrigCommands())
+ } else if len(os.Args) > 1 && os.Args[1] == "testrig" {
+ log.Fatalln("gotosocial must be built and run with the DEBUG enviroment variable set to enable and access testrig")
}
// run