codestarterorg/ubuntu-chromebook-installer — pull request #2 by samrocketman (2014-08-07 01:17:57+00:00)
Title: Cleanup bash code style

There was a lot to clean up. I ended up using vim search and replace on selection to help me out with replacing all of the `$var` with `${var}`. I used the following expression to help me with substitution. It is kind of a garbled mess to look at but it has been battle tested throughout all of the scripts one by one. It does not play nice with `sed` unfortunately due to quoting issues.

:'<,'>s#$\([^0-9(\{]\{1\}[^/{} '"()\\;.|`+*-]\+\)#${\1}#g

I also quoted where I knew would make sense like when using `cd` and other commands or surrounding command substitution. Some of the places I didn't quote but should probably be quoted is multiline subshells where python is executed. The multiline subshells can be found in the following files:

* `profiles/devices/acer-c720/scripts/reinstall-vmlinuz.sh`
* `profiles/devices/acer-c720/scripts/trusty-patch.sh`

I didn't change them because I didn't know what the behavior would be and don't really have time to test it at the moment.

Also a BIG DISCLAIMER before you merge these patches. I don't have a Chromebook at all so my changes are largely untested. The only way I could really test was just for syntax from the project root with the following command:

find . -type f -name '*.sh' -o -type f -name '*.profile' -print0 | xargs -0 -I '{}' bash -n '{}'

Please do me a favor by testing my changes since I'm not able. Thanks.