Skip to content

Commit

Permalink
#138 Allow to pass value that has bash escape characters the help of …
Browse files Browse the repository at this point in the history
…base64 encoding/decoding.
  • Loading branch information
herpiko committed Jul 16, 2021
1 parent 472ee2e commit f718022
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/cli/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
b64 "encoding/base64"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -606,7 +607,7 @@ func main() {
// Signing a token
log.Println("Signing auth token...")
cmdStr = "cd " + homeDir + "/.irgsh/tmp/" + tmpID
cmdStr += "/ && echo '" + string(jsonByte) + "' > token && gpg -u " + maintainerSigningKey + " --clearsign --output token.sig --sign token"
cmdStr += "/ && echo '" + b64.StdEncoding.EncodeToString(jsonByte) + "' | base64 -d > token && gpg -u " + maintainerSigningKey + " --clearsign --output token.sig --sign token"
fmt.Println(cmdStr)
cmd = exec.Command("bash", "-c", cmdStr)
// Make it interactive
Expand Down

0 comments on commit f718022

Please sign in to comment.