aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/js.bash
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-01 22:45:05 -0500
committerJesús <heckyel@hyperbola.info>2021-12-01 22:45:05 -0500
commit0ef5a8fe632e568c1b80572ae23e46c61f2da185 (patch)
tree352d7273796b975227eca82f34857be71abf9052 /scripts/js.bash
downloadcountries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.tar.lz
countries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.tar.xz
countries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.zip
initial public
Diffstat (limited to 'scripts/js.bash')
-rw-r--r--scripts/js.bash32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/js.bash b/scripts/js.bash
new file mode 100644
index 0000000..c9d88a6
--- /dev/null
+++ b/scripts/js.bash
@@ -0,0 +1,32 @@
+#!/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()
+{
+ declare -a files=(
+ 'switch-storage'
+ 'main'
+ )
+
+ for i in "${files[@]}";
+ do
+ install -m644 "${_target%scripts}/src/js/${i}.js" "${_dest}"
+ done
+ unset files
+}
+
+# ==============================================================================
+# EXECUTION - START
+# ==============================================================================
+run_prepare "$@"
+run_switch_storage "$@"