about summary refs log tree commit diff stats
path: root/home-manager/config/lf/commands/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhome-manager/config/lf/commands/scripts/mk_scr_default (renamed from home-manager/config/lf/commands/scripts/mk_scr)0
-rwxr-xr-xhome-manager/config/lf/commands/scripts/mk_scr_temp31
2 files changed, 31 insertions, 0 deletions
diff --git a/home-manager/config/lf/commands/scripts/mk_scr b/home-manager/config/lf/commands/scripts/mk_scr_default
index 2f265aad..2f265aad 100755
--- a/home-manager/config/lf/commands/scripts/mk_scr
+++ b/home-manager/config/lf/commands/scripts/mk_scr_default
diff --git a/home-manager/config/lf/commands/scripts/mk_scr_temp b/home-manager/config/lf/commands/scripts/mk_scr_temp
new file mode 100755
index 00000000..e8a92c5e
--- /dev/null
+++ b/home-manager/config/lf/commands/scripts/mk_scr_temp
@@ -0,0 +1,31 @@
+#! /usr/bin/env dash
+
+# shellcheck source=/dev/null
+SHELL_LIBRARY_VERSION="1.1.3" . %SHELL_LIBRARY_PATH
+
+
+prompt "Script name: "
+name=""
+while [ -z "$name" ] || [ -e "$name" ]
+do
+  read -r name
+  if [ -e "$name" ]; then
+    prompt "Script already exists, overwrite [y|N]: "
+    read -r ans
+
+    if [ "$ans" = "y" ]; then
+      break
+    else
+      prompt "Script Name: "
+    fi
+  fi
+done
+
+script="$(pwd)"/"$name"
+
+sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" > "$script"
+chmod +x "$script"
+"$VISUAL" "$script"
+
+
+# vim: ft=sh