File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ var addCmd = &cobra.Command{
6262 PreRun : func (cmd * cobra.Command , args []string ) {
6363 if verbose {
6464 log .SetLevel (log .DebugLevel )
65+ keyring .Debug = true
6566 }
6667 },
6768 Run : func (cmd * cobra.Command , args []string ) {
@@ -169,14 +170,22 @@ var addCmd = &cobra.Command{
169170 log .Fatal (err )
170171 }
171172
172- ring , _ := keyring .Open (keyringDefaults )
173+ ring , err := keyring .Open (keyringDefaults )
174+ if err != nil {
175+ log .Fatalf ("failed to open keyring backend: %s" , strings .ToLower (err .Error ()))
176+ }
173177
174- _ = ring .Set (keyring.Item {
178+ resp : = ring .Set (keyring.Item {
175179 Key : fmt .Sprintf ("%s-%s" , profileName , authType ),
176180 Data : []byte (authValue ),
177181 })
178182
179- fmt .Println ("\n Success! Credentials have been set and are now ready for use!" )
183+ if resp == nil {
184+ fmt .Println ("\n Success! Credentials have been set and are now ready for use!" )
185+ } else {
186+ // error of some sort
187+ log .Fatal ("Error adding credentials to keyring: " , resp )
188+ }
180189 },
181190}
182191
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ var execCmd = &cobra.Command{
5454 PreRun : func (cmd * cobra.Command , args []string ) {
5555 if verbose {
5656 log .SetLevel (log .DebugLevel )
57+ keyring .Debug = true
5758 }
5859 },
5960 Run : func (cmd * cobra.Command , args []string ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ if [ -d build ]; then
1515fi
1616mkdir -p build
1717
18- platforms=(" windows/amd64" " linux/amd64" " darwin/amd64" )
18+ platforms=(" windows/amd64" " linux/amd64" " darwin/amd64" " darwin/arm64 " )
1919
2020echo " ==> Build started for v${version} "
2121
3535 GCFLAGS=" -gcflags=all=-trimpath=$GOPATH -asmflags=all=-trimpath=$GOPATH "
3636
3737 if [ $GOOS = " windows" ]; then
38- env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o " build/${GOOS} /cf-vault.exe" -ldflags " -X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha} " .
38+ env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o " build/${GOOS} /${GOARCH} / cf-vault.exe" -ldflags " -X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha} " .
3939 else
40- env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o " build/${GOOS} /cf-vault" -ldflags " -X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha} " .
40+ env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o " build/${GOOS} /${GOARCH} / cf-vault" -ldflags " -X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha} " .
4141 fi
4242 if [ $? -ne 0 ]; then
4343 echo " Building the binary has failed!"
4848
4949 printf " ==> Tarballing %s\t%s\n" " $platform " " build/${output_name} .tar.gz" | expand -t 30
5050 if [ $GOOS = " windows" ]; then
51- tar -czf " build/${output_name} .tar.gz" -C " build/$GOOS " " cf-vault.exe"
51+ tar -czf " build/${output_name} .tar.gz" -C " build/$GOOS / $GOARCH " " cf-vault.exe"
5252 else
53- tar -czf " build/${output_name} .tar.gz" -C " build/$GOOS " " cf-vault"
53+ tar -czf " build/${output_name} .tar.gz" -C " build/$GOOS / $GOARCH " " cf-vault"
5454 fi
5555
5656 if [ $? -ne 0 ]; then
5959 fi
6060
6161 echo " ==> Adding file checksums to build/checksums.txt"
62- shasum -a 256 build/$GOOS /* >> " build/checksums.txt"
62+ shasum -a 256 build/$GOOS /$GOARCH / * >> " build/checksums.txt"
6363done
6464
6565shasum -a 256 build/* .tar.gz >> " build/checksums.txt"
You can’t perform that action at this time.
0 commit comments