mirror of
https://github.com/rwinkhart/sshyp-labs.git
synced 2026-09-06 00:57:19 -04:00
gpgToRCW: Trim .gpg suffixes from source files (useful for Pass migrations)
This commit is contained in:
@@ -37,6 +37,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
var decLines []string
|
var decLines []string
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
|
entry = strings.TrimSuffix(entry, ".gpg")
|
||||||
decLines = decryptGPG(core.TargetLocationFormat(entry))
|
decLines = decryptGPG(core.TargetLocationFormat(entry))
|
||||||
encBytes := wrappers.Encrypt([]byte(strings.Join(decLines, "\n")), rcwPassphrase)
|
encBytes := wrappers.Encrypt([]byte(strings.Join(decLines, "\n")), rcwPassphrase)
|
||||||
err := os.WriteFile(outputDir+strings.ReplaceAll(entry, "/", core.PathSeparator), encBytes, 0600)
|
err := os.WriteFile(outputDir+strings.ReplaceAll(entry, "/", core.PathSeparator), encBytes, 0600)
|
||||||
|
|||||||
Reference in New Issue
Block a user