Skip to content

Instantly share code, notes, and snippets.

@qgervacio
Last active October 9, 2020 15:12
Show Gist options
  • Save qgervacio/c430b652dde1434150d69bbe359326f4 to your computer and use it in GitHub Desktop.
Save qgervacio/c430b652dde1434150d69bbe359326f4 to your computer and use it in GitHub Desktop.
test
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