Skip to content

Commit

Permalink
Update promptui to v0.8.0, add checking for ssh executable exists
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciferInLove committed Oct 3, 2020
1 parent c2245a3 commit 902a13d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.3] - 2020-10-03

### Changed
- Promptui library is updated to v0.8.0
- Added checking for ssh executable exists

## [0.0.2] - 2020-07-30

### Changed
Expand All @@ -19,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[unreleased]: https://github.com/LuciferInLove/dynamic-sshmenu-aws/compare/v0.0.2...HEAD
[unreleased]: https://github.com/LuciferInLove/dynamic-sshmenu-aws/compare/v0.0.3...HEAD
[0.0.3]: https://github.com/LuciferInLove/dynamic-sshmenu-aws/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/LuciferInLove/dynamic-sshmenu-aws/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/LuciferInLove/dynamic-sshmenu-aws/releases/tag/v0.0.1
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ require (
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/manifoldco/promptui v0.7.0
github.com/manifoldco/promptui v0.8.0
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/stretchr/testify v1.6.1 // indirect
Expand All @@ -19,8 +18,7 @@ require (
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 // indirect
golang.org/x/text v0.3.3 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)

replace github.com/manifoldco/promptui v0.7.0 => github.com/LuciferInLove/promptui v0.7.1-0.20200730125009-7b2707b82ee7
replace github.com/manifoldco/promptui v0.8.0 => github.com/LuciferInLove/promptui v0.7.1-0.20201003113208-3398ab7c53db
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/LuciferInLove/promptui v0.7.0 h1:2cvObhHA4kLJdGCuxIw10Inmvdq1rWiM1BdaAGbzRho=
github.com/LuciferInLove/promptui v0.7.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ=
github.com/LuciferInLove/promptui v0.7.1-0.20200604215815-d8893f35f691 h1:p5iB/xsJsMO/lU0xXMYJHl33tFlMrxS5hXoqlP2jgIo=
github.com/LuciferInLove/promptui v0.7.1-0.20200604215815-d8893f35f691/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ=
github.com/LuciferInLove/promptui v0.7.1-0.20200730125009-7b2707b82ee7 h1:C5O4ctp1XtKhHFDiLCbtPOZFlMlEUK5QB6XjF47krew=
github.com/LuciferInLove/promptui v0.7.1-0.20200730125009-7b2707b82ee7/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ=
github.com/LuciferInLove/promptui v0.7.1-0.20201003113208-3398ab7c53db h1:1W+7EPFv+cNIapVnW/9S1ss2TWPBzr/K1OwlmdstPF4=
github.com/LuciferInLove/promptui v0.7.1-0.20201003113208-3398ab7c53db/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ=
github.com/aws/aws-sdk-go v1.32.13 h1:zzyXF7SUxJcJa3hTcYCl1/Ey+kh2N8TjK5tWnL0wieo=
github.com/aws/aws-sdk-go v1.32.13/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.33.4 h1:lhVZe2TkSjJz26jPBCBAvJvAy70Yxxlbm/Ciw1gmyRY=
Expand Down
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 902a13d

Please sign in to comment.