[TxMt] Bug resolved, Shell Script Plugin, TMPFILE creation

robertharder.alt at mac.com robertharder.alt at mac.com
Tue Feb 22 18:55:08 UTC 2011


BUG: 
When using the Shell Script plugin's tempfile creation expansion (temp[tab]), a dollar sign gets left out:

temp[tab]

becomes 

TMPFILE="(mktemp -t Convert_ClassOO_Metrics_To_Tabular)"
trap "rm -f '$TMPFILE'" 0               # EXIT
trap "rm -f '$TMPFILE'; exit 1" 2       # INT
trap "rm -f '$TMPFILE'; exit 1" 1 15    # HUP TERM

Note the missing dollar sign $ in the first line to make the parentheses executable.


FIX: 
I added a backslash in the bundle before the dollar sign that's there and is getting dropped (or rather, interpreted as a variable probably):

${1:TMPFILE}="$(mktemp....

becomes

${1:TMPFILE}="\$(mktemp....

${1:TMPFILE}="\$(mktemp -t ${2:`echo "${TM_FILENAME%.*}" | sed -e 's/[^a-zA-Z]/_/g' -e 's/^$/untitled/'`})"
${3:${4/(.+)/trap "/}${4:rm -f '\$${1/.*\s//}'}${4/(.+)/" 0               # EXIT
/}${5/(.+)/trap "/}${5:rm -f '\$${1/.*\s//}'; exit 1}${5/(.+)/" 2       # INT
/}${6/(.+)/trap "/}${6:rm -f '\$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15    # HUP TERM
/}}

Not sure how to work that change into the codebase.

-Rob


More information about the textmate mailing list