Merge pull request #704 from toogley/master

make default settings for bash more reliable
This commit is contained in:
Louis Pilfold 2016-03-20 19:36:19 +00:00
commit 06168f1d08
2 changed files with 9 additions and 0 deletions

View File

@ -33,6 +33,10 @@ snippet !env "#!/usr/bin/env (!env)"
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
endsnippet
snippet sbash "safe bash options"
`!p snip.rv = '#!/usr/bin/env bash' + "\nset -euo pipefail\nIFS=$'\n\t'" + "\n\n" `
endsnippet
snippet temp "Tempfile"
${1:TMPFILE}="$(mktemp -t ${2:`!p
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"

View File

@ -5,6 +5,11 @@ snippet #!
snippet bash
#!/usr/bin/env bash
snippet sbash
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
snippet if
if [[ ${1:condition} ]]; then
${0:#statements}