From 7c51e2d6926a0a22312f369a220fd62839cb13e3 Mon Sep 17 00:00:00 2001 From: Reid Vandewiele Date: Thu, 2 Apr 2020 12:22:53 -0700 Subject: [PATCH] Provide mv wrapper task This task exists as a convenience for users who need predictable sudo commands without variance to write into their sudoers rules. The only real variable in commands used by peadm is the filename of the PE installer tarball. This task can be used in a pre-plan to homogenize calls to sudo. Rather than literally calling "mv" with a variable filename, the mv.sh task can be called. Inputs come as environment variables so the call doesn't change. --- tasks/mv.json | 17 +++++++++++++++++ tasks/mv.sh | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tasks/mv.json create mode 100644 tasks/mv.sh diff --git a/tasks/mv.json b/tasks/mv.json new file mode 100644 index 00000000..5e2da83c --- /dev/null +++ b/tasks/mv.json @@ -0,0 +1,17 @@ +{ + "description": "Wrapper task for mv command", + "parameters": { + "source": { + "type": "String", + "description": "Current path of file" + }, + "target": { + "type": "String", + "description": "New path of file" + } + }, + "input_method": "environment", + "implementations": [ + {"name": "mv.sh"} + ] +} diff --git a/tasks/mv.sh b/tasks/mv.sh new file mode 100644 index 00000000..fd38e118 --- /dev/null +++ b/tasks/mv.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# This task exists as a convenience for users who need predictable sudo +# commands without variance to write into their sudoers rules. The only real +# variable in commands used by peadm is the filename of the PE installer +# tarball. This task can be used in a pre-plan to homogenize calls to sudo. +# Rather than literally calling "mv" with a variable filename, the mv.sh task +# can be called. Inputs come as environment variables so the call doesn't +# change. + +mv "$PT_source" "$PT_target"