aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/js.bash
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/js.bash')
-rw-r--r--scripts/js.bash27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/js.bash b/scripts/js.bash
new file mode 100644
index 0000000..0d16175
--- /dev/null
+++ b/scripts/js.bash
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+_dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
+_target="${_dir%/*}" # deleted slash
+_dest="${_target%scripts}/dist/js/"
+
+# ==============================================================================
+# FUNCTIONS - START
+# ==============================================================================
+run_prepare() {
+ install -d -m755 "${_dest}"
+}
+
+run_switch_storage()
+{
+ local _name="${1-switch-storage}"
+ local _src="${_target%scripts}/src/js/${_name}.js" # input
+ if [[ -n "${_src}" ]]; then
+ cp -fv "${_src}" "${_dest}"
+ fi
+}
+
+# ==============================================================================
+# EXECUTION - START
+# ==============================================================================
+run_prepare "$@"
+run_switch_storage "$@"