WIP: feat: translation support
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
See #483
This commit is contained in:
@ -5,13 +5,14 @@ import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"coopcloud.tech/abra/pkg/i18n"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
)
|
||||
|
||||
// PassInsertSecret inserts a secret into a pass store.
|
||||
func PassInsertSecret(secretValue, secretName, appName, server string) error {
|
||||
if _, err := exec.LookPath("pass"); err != nil {
|
||||
return errors.New("pass command not found on $PATH, is it installed?")
|
||||
return errors.New(i18n.G("pass command not found on $PATH, is it installed?"))
|
||||
}
|
||||
|
||||
cmd := fmt.Sprintf(
|
||||
@ -19,13 +20,13 @@ func PassInsertSecret(secretValue, secretName, appName, server string) error {
|
||||
secretValue, server, appName, secretName,
|
||||
)
|
||||
|
||||
log.Debugf("attempting to run %s", cmd)
|
||||
log.Debug(i18n.G("attempting to run %s", cmd))
|
||||
|
||||
if err := exec.Command("bash", "-c", cmd).Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("%s inserted into pass store", secretName)
|
||||
log.Info(i18n.G("%s inserted into pass store", secretName))
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -33,7 +34,7 @@ func PassInsertSecret(secretValue, secretName, appName, server string) error {
|
||||
// PassRmSecret deletes a secret from a pass store.
|
||||
func PassRmSecret(secretName, appName, server string) error {
|
||||
if _, err := exec.LookPath("pass"); err != nil {
|
||||
return errors.New("pass command not found on $PATH, is it installed?")
|
||||
return errors.New(i18n.G("pass command not found on $PATH, is it installed?"))
|
||||
}
|
||||
|
||||
cmd := fmt.Sprintf(
|
||||
@ -41,13 +42,13 @@ func PassRmSecret(secretName, appName, server string) error {
|
||||
server, appName, secretName,
|
||||
)
|
||||
|
||||
log.Debugf("attempting to run %s", cmd)
|
||||
log.Debug(i18n.G("attempting to run %s", cmd))
|
||||
|
||||
if err := exec.Command("bash", "-c", cmd).Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("%s removed from pass store", secretName)
|
||||
log.Info(i18n.G("%s removed from pass store", secretName))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user