From aab85f3600caf04b491d6ca4fc3f0f004d9e3fc0 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Mon, 29 Jul 2019 14:33:01 +0800 Subject: Support falling back to ruby version of checkers Rename the ruby scripts to have `-ruby` suffix and add a symlink for both to `./gitlab-shell`. The executable name will be used to determine how args will be parsed. For now, we only parse the arguments for gitlab-shell commands. If the executable is `gitlab-shell-authorized-keys-check` or `gitlab-shell-authorized-principals-check`, it'll always fallback to the ruby version. Ruby specs test the ruby script, the fallback from go to ruby and go implementation of both (still pending). --- go/internal/command/command.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'go/internal/command/command.go') diff --git a/go/internal/command/command.go b/go/internal/command/command.go index a1dde42..77feda8 100644 --- a/go/internal/command/command.go +++ b/go/internal/command/command.go @@ -19,7 +19,6 @@ type Command interface { func New(arguments []string, config *config.Config, readWriter *readwriter.ReadWriter) (Command, error) { args, err := commandargs.Parse(arguments) - if err != nil { return nil, err } @@ -30,7 +29,7 @@ func New(arguments []string, config *config.Config, readWriter *readwriter.ReadW } } - return &fallback.Command{RootDir: config.RootDir, Args: arguments}, nil + return &fallback.Command{RootDir: config.RootDir, Args: args}, nil } func buildCommand(args *commandargs.CommandArgs, config *config.Config, readWriter *readwriter.ReadWriter) Command { -- cgit v1.2.1