mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
[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.
This commit is contained in:
parent
83be140f0b
commit
55300cbd73
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue