AutoYADM commit: 2025-06-15 16:06:51

This commit is contained in:
Daniel Fichtinger 2025-06-15 16:06:51 -04:00
parent 2a72d57d61
commit c913755fd7

View file

@ -3,9 +3,10 @@ function mksh --description 'make executable shell script'
set name $argv[1]
set file $name.sh
if set -q _flag_e
set cmd (printf 'rename-buffer -file %s ; set buffer filetype sh ; hook -once -always buffer BufWritePost %s %s ; hook -once -always buffer NormalIdle .* %s' "$file" "$(string replace -a . \\. -- $file)" "%{ nop %sh { notify-send 'this runs' } }" "%{ exec -with-hooks gji }")
set cmd (printf 'rename-buffer -file %s \\n set buffer filetype sh \\n hook -once -always buffer BufWritePost %s %s \\n hook -once -always buffer NormalIdle .* %s' "$file" "$(string replace -a . \\. -- $(path resolve $file))" "%{ nop %sh{ notify-send hey } }" "%{ exec -with-hooks gji }")
# set cmd (printf 'rename-buffer -file %s ; set buffer filetype sh ; hook -once -always buffer BufWritePost %s %s ; hook -once -always buffer NormalIdle .* %s' "$file" "$(string replace -a . \\. -- $file)" "%{ nop %sh { chmod +x $(path resolve $file) } }" "%{ exec -with-hooks gji }")
printf '#!/bin/sh\n\n' | kak -e "$cmd"
# printf '#!/bin/sh\n\n' | kak -e "echo -debug -- $cmd"
else
printf '#!/bin/sh\n\n' >$file
chmod +x $file