Merge pull request #93 from gmasse/fix_templater

templater.sh: Update Regexp to not match ${_} for replacement
This commit is contained in:
Izaak "Zaak" Beekman 2017-08-21 09:29:42 -04:00 committed by GitHub
commit d25d6a0106
2 changed files with 3 additions and 2 deletions

View File

@ -15,9 +15,10 @@ Released: TBA.
- [ ] Upgrade to `lanyon@0.0.55`
- [x] Fix typos in megamount (thanks @gsaponaro)
- [x] Enable color in screen or tmux (#92, @gmasse)
- [x] Enable color in screen or tmux (#92, @gmasse)
- [x] Change `egrep` to `grep -E` in test and lib scripts to comply with ShellCheck (#92, @gmasse)
- [x] Fix typo in FAQ (#92, @gmasse)
- [x] Fix Travis CI failure on src/templater.sh (@gmasse)
## v2.3.0

View File

@ -40,7 +40,7 @@ function templater() {
fi
cp -f "${templateSrc}" "${templateDst}"
for var in $(env |awk -F= '{print $1}' |grep -E '^[A-Z0-9_]+$'); do
for var in $(env |awk -F= '{print $1}' |grep -E '^(_[A-Z0-9_]+|[A-Z0-9][A-Z0-9_]*)$'); do
sed -i.bak -e "s#\${${var}}#${!var}#g" "${templateDst}"
# this .bak dance is done for BSD/GNU portability: http://stackoverflow.com/a/22084103/151666
rm -f "${templateDst}.bak"