bash-support icon indicating copy to clipboard operation
bash-support copied to clipboard

Issue with editing template to have default value show up in skel correctly..

Open Guyverix opened this issue 1 year ago • 1 comments

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() {
  cat 

And this is what the generated output looks like:

usage() {
        cat 

As 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?

Guyverix avatar Oct 31 '22 15:10 Guyverix

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.

Guyverix avatar Oct 31 '22 15:10 Guyverix