diff --git a/CHANGELOG.md b/CHANGELOG.md index 6192ad0..57bce79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 \ No newline at end of file diff --git a/go.mod b/go.mod index 1aac015..6c04379 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 24ab1d7..5cbf414 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/main.go b/main.go index ee110e3..fd20ed2 100644 --- a/main.go +++ b/main.go @@ -22,13 +22,17 @@ type instance struct { } var ( - version = "v0.0.1" + version = "v0.0.3" appAuthor *cli.Author = &cli.Author{ Name: "LuciferInLove", Email: "lucifer.in.love@ya.ru", } ) +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