-
-
Save qgervacio/c430b652dde1434150d69bbe359326f4 to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
final def output = [] | |
final shell = new Shell(this.script) | |
// find all target files | |
def path = args.path?: "." | |
shell.call(command: "find ${path} -name '*${args.decrypt.gpgExt}'", capture: true).split("\n").each { | |
final def file = new File(it) | |
final def parent = file.getParent() | |
final def tFile = file.getName() | |
final def oFile = tFile.replace(args.decrypt.gpgExt, "") | |
final def cmd = "gpg --homedir=${args.homedir} -o " + | |
"${parent}/${oFile} -d ${it}" | |
output << shell.call(command: cmd, capture: true) | |
} | |
return args.capture ? output?.join("\n") : null | |
} | |
catch (e) { | |
this.err(args, e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment