diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-08-23 22:35:19 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 21:32:48 +1000 |
commit | c3d7de1c183ddf2bea39647114403d16825fdd9d (patch) | |
tree | 57a4ead9c3cdc0ce3a54cc697bf847953b29ff11 /pkg/commands/oscommands | |
parent | 711bd5a670f5321495700a55503e4d4a9742f7ae (diff) |
Change not to use cat command
Diffstat (limited to 'pkg/commands/oscommands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 13 | ||||
-rw-r--r-- | pkg/commands/oscommands/os_default_platform.go | 1 | ||||
-rw-r--r-- | pkg/commands/oscommands/os_windows.go | 1 |
3 files changed, 0 insertions, 15 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index cf050cf53..5a35b9278 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -24,7 +24,6 @@ import ( // Platform stores the os state type Platform struct { OS string - CatCmd []string Shell string ShellArg string EscapedQuote string @@ -217,18 +216,6 @@ func (c *OSCommand) RunCommandWithOutputLive(command string, output func(string) return RunCommandWithOutputLiveWrapper(c, command, output) } -func (c *OSCommand) CatFile(filename string) (string, error) { - arr := append(c.Platform.CatCmd, filename) - cmdStr := strings.Join(arr, " ") - c.Log.WithField("command", cmdStr).Info("Cat") - cmd := c.Command(arr[0], arr[1:]...) - output, err := sanitisedCommandOutput(cmd.CombinedOutput()) - if err != nil { - c.Log.WithField("command", cmdStr).Error(output) - } - return output, err -} - // DetectUnamePass detect a username / password / passphrase question in a command // promptUserForCredential is a function that gets executed when this function detect you need to fillin a password or passphrase // The promptUserForCredential argument will be "username", "password" or "passphrase" and expects the user's password/passphrase or username back diff --git a/pkg/commands/oscommands/os_default_platform.go b/pkg/commands/oscommands/os_default_platform.go index 3fb579eec..f91cc2651 100644 --- a/pkg/commands/oscommands/os_default_platform.go +++ b/pkg/commands/oscommands/os_default_platform.go @@ -9,7 +9,6 @@ import ( func getPlatform() *Platform { return &Platform{ OS: runtime.GOOS, - CatCmd: []string{"cat"}, Shell: "bash", ShellArg: "-c", EscapedQuote: `"`, diff --git a/pkg/commands/oscommands/os_windows.go b/pkg/commands/oscommands/os_windows.go index 206d50433..611467581 100644 --- a/pkg/commands/oscommands/os_windows.go +++ b/pkg/commands/oscommands/os_windows.go @@ -3,7 +3,6 @@ package oscommands func getPlatform() *Platform { return &Platform{ OS: "windows", - CatCmd: []string{"cmd", "/c", "type"}, Shell: "cmd", ShellArg: "/c", EscapedQuote: `\"`, |