bash-support
bash-support copied to clipboard
Issue with editing template to have default value show up in skel correctly..
I have run into a bit of trouble with the Template file. I am attempting to add a hard coded set of default values into the skeleton that is created with a new file. Overall the issue is minor, as it is more of a format problem than a real code bug. It is just frustrating as it makes the generated skeleton look sloppy.
Here is what I am attempting to add:
== Skeleton.script-set == nomenu, below == #set -o nounset # Treat unset variables as an error #set -o pipefai # Any non-zero exits in pipes fail #set -e # Any non-zero exit is a failure #canonicalpath=`readlink -f $0` # Breaks Mac due to readlink differences #canonicaldirname=`dirname ${canonicalpath}`/.. # Breaks Mac #samedirname=`dirname ${canonicalpath}` # Breaks Mac usage() { catAnd this is what the generated output looks like:
usage() { catAs you can see, I loose some formatting and gain goofed up indents in other areas. What would be the correct way to deal with this in the Template file?
I guess I should clarify a bit. My scripts always have a help system, and an option to debug. Thats why I am attempting to add to the skeleton generation rather than trying to build into the menu system to add manually every time I build out a new script.