-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update promptui to v0.8.0, add checking for ssh executable exists
- Loading branch information
LuciferInLove
committed
Oct 3, 2020
1 parent
c2245a3
commit 902a13d
Showing
4 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,17 @@ type instance struct { | |
} | ||
|
||
var ( | ||
version = "v0.0.1" | ||
version = "v0.0.3" | ||
appAuthor *cli.Author = &cli.Author{ | ||
Name: "LuciferInLove", | ||
Email: "[email protected]", | ||
} | ||
) | ||
|
||
const ( | ||
sshExecutable = "ssh" | ||
) | ||
|
||
func main() { | ||
app := &cli.App{ | ||
Name: "dynamic-sshmenu-aws", | ||
|
@@ -183,7 +187,13 @@ func action(c *cli.Context) error { | |
return err | ||
} | ||
|
||
cmd := exec.Command("ssh", instanceFromResult.IP) | ||
sshPath, err := exec.LookPath(sshExecutable) | ||
|
||
if err != nil { | ||
return fmt.Errorf("%w", err) | ||
} | ||
|
||
cmd := exec.Command(sshPath, instanceFromResult.IP) | ||
cmd.Stdin = os.Stdin | ||
cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
|