Windows support (fixed #217)

* Swap out gopass dependency

Remove github.com/mewbak/gopass in favor of github.com/howeyc/gopass

* Add Windows to Makefile and build_release

Added Windows/386 and Windows/amd64 to the Makefile.  Some minor changes
needed to be made to build_release to give the windows binary the ".exe"
extension.

* Makefile: remove windows/amd64
This commit is contained in:
Nick Scheibenpflug authored and Andrey Petrov committed 2016-09-15 13:52:55 -04:00
1 parent 3535fb35bb
commit 55c1def24d
6 files changed
+17 -11

No files matched your search

+3 -4
View File
@@ -6,10 +6,6 @@
path = vendor/github.com/jessevdk/go-flags
url = https://github.com/jessevdk/go-flags
branch = master
[submodule "vendor/github.com/mewbak/gopass"]
path = vendor/github.com/mewbak/gopass
url = https://github.com/mewbak/gopass
branch = master
[submodule "vendor/github.com/shazow/rateio"]
path = vendor/github.com/shazow/rateio
url = https://github.com/shazow/rateio
@@ -18,3 +14,6 @@
path = vendor/github.com/dustin/go-humanize
url = https://github.com/dustin/go-humanize
branch = master
[submodule "vendor/github.com/howeyc/gopass"]
path = vendor/github.com/howeyc/gopass
url = https://github.com/howeyc/gopass.git
+1
View File
@@ -39,3 +39,4 @@ release:
GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
GOOS=freebsd GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
GOOS=windows GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
+6 -1
View File
@@ -37,6 +37,11 @@ build() {
local bin="$(basename $package)"
local tarball="${bin}-${GOOS}_${GOARCH}.tgz"
local outdir="$BUILDDIR/$bin"
local tardir="$bin"
if [ "$GOOS" == "windows" ]; then
bin="$bin.exe"
fi
if [[ -d "$outdir" ]]; then
echo "err: outdir already exists: $PWD/$outdir"
@@ -51,7 +56,7 @@ build() {
fi
# Create tarball
tar -C "$BUILDDIR" -czvf "$BUILDDIR/$tarball" "$bin"
tar -C "$BUILDDIR" -czvf "$BUILDDIR/$tarball" "$tardir"
# Cleanup
rm -rf "$outdir"
+6 -5
View File
@@ -7,7 +7,7 @@ import (
"io/ioutil"
"os"
"github.com/mewbak/gopass"
"github.com/howeyc/gopass"
)
// ReadPrivateKey attempts to read your private key and possibly decrypt it if it
@@ -28,14 +28,15 @@ func ReadPrivateKey(path string) ([]byte, error) {
return privateKey, nil
}
passphrase := os.Getenv("IDENTITY_PASSPHRASE")
if passphrase == "" {
passphrase, err = gopass.GetPass("Enter passphrase: ")
passphrase := []byte(os.Getenv("IDENTITY_PASSPHRASE"))
if len(passphrase) == 0 {
fmt.Print("Enter passphrase: ")
passphrase, err = gopass.GetPasswd()
if err != nil {
return nil, fmt.Errorf("couldn't read passphrase: %v", err)
}
}
der, err := x509.DecryptPEMBlock(block, []byte(passphrase))
der, err := x509.DecryptPEMBlock(block, passphrase)
if err != nil {
return nil, fmt.Errorf("decrypt failed: %v", err)
}
Generated Vendored Submodule
+1