AutoYADM commit: 2025-06-15 15:51:50
This commit is contained in:
parent
53d84afc8d
commit
2a72d57d61
2 changed files with 6 additions and 7 deletions
|
@ -1,12 +1,13 @@
|
|||
function mksh --description 'make executable shell script'
|
||||
argparse 'e/edit' -- $argv
|
||||
set name $argv[1]
|
||||
echo $name.sh
|
||||
set file $name.sh
|
||||
echo $file
|
||||
printf '#!/bin/sh\n\n' >$file
|
||||
chmod +x $file
|
||||
if set -q _flag_e
|
||||
kak "$file" -e 'exec -with-hooks gjo'
|
||||
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 ; 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"
|
||||
else
|
||||
printf '#!/bin/sh\n\n' >$file
|
||||
chmod +x $file
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue