add a check to execute command beginning by $

This commit is contained in:
BarbUk 2018-05-17 15:36:07 +04:00
parent a684117ab6
commit 749b08929b

6
snippy
View File

@ -6,6 +6,8 @@
# . {clipboard} placeholder to use current clipboard in snippet
# . {cursor} placeholder to place the cursor
# . ##noparse header in snippet to not parse
# . execute command begining by $
#
# augmented by "opennomad": https://gist.github.com/opennomad/15c4d624dce99066a82d
# originally written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2
# Based on "snippy" by "sessy"
@ -88,8 +90,8 @@ run(){
content="$(bashdown < "${DIR}/${FILE}")"
fi
printf "%s" "$content" > $TMPFILE
else
${FILE} &> $TMPFILE # execute as bashcommand
else [[ ${FILE} =~ ^$ ]]
${FILE##*$} 2>/dev/null > $TMPFILE # execute as bashcommand
fi
local current_clip cursor