aboutsummaryrefslogtreecommitdiff
path: root/config/command.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-11-17 10:13:06 +0100
committerJulien Dessaux2021-11-17 10:13:06 +0100
commitc3263c03776401ad1263a9fb8f5a44a8ed44d61b (patch)
tree7dac91753cb4428ede2ba72fb09eca9ba6c2daab /config/command.go
parentUpdated dependencies (diff)
downloadshell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.gz
shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.bz2
shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.zip
Refactored package structure
Diffstat (limited to 'config/command.go')
-rw-r--r--config/command.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/config/command.go b/config/command.go
deleted file mode 100644
index 34142cd..0000000
--- a/config/command.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package config
-
-import (
- "strings"
-
- "github.com/pkg/errors"
-)
-
-func validateCommand(cmd string) error {
- tokens := strings.Split(cmd, " ")
- switch tokens[0] {
- case "cp":
- if len(tokens) != 3 {
- return errors.New("cp command takes exactly two arguments")
- }
- case "exec":
- if len(tokens) <= 1 {
- return errors.New("exec command needs arguments")
- }
- case "mkdir":
- if len(tokens) != 2 {
- return errors.New("mkdir command takes exactly one argument")
- }
- case "wait":
- if len(tokens) != 1 {
- return errors.New("wait command takes no arguments")
- }
- default:
- return errors.New("Invalid command : " + tokens[0])
- }
- return nil
-}