about summary refs log tree commit diff stats
path: root/home-manager/config/lf/commands/scripts/mk_scr
blob: 99f9f1d60bde873846fa7e87f99d0c464e7e2dbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/env dash

# shellcheck source=/dev/null
SHELL_LIBRARY_VERSION="1.1.3" . %SHELL_LIBRARY_PATH

script=$(mktmp)
cat "%SHELL_LIBRARY_TEMPLATE" > "$script"

readp "Script Name: " script_name
scr="$(pwd)"/"$script_name"

while [ -e "$scr" ];do
    readp "$script_name already exists, new name for script: " script_name
    scr="$(pwd)"/"$script_name"
done

cat "$script" > "$scr"
chmod +x "$scr"


"$VISUAL" "$scr"
# vim: ft=sh