ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

cleanup shell coding #94

Closed Kriechi closed 10 years ago

Kriechi commented 10 years ago
ysbaddaden commented 10 years ago
Kriechi commented 10 years ago

Not sure if the [] vs [[]] thing changed with some version of bash, but I used to think that it triggers running the test executable - creating some kind of overhead. Therefore I always use the bash syntax - with double brackets. http://unix.stackexchange.com/a/32211

The newline thing was inconsistent so I choose one and normalised it. So no newline changes at all? I will split the changes into 3 commits - so you can cherry-pick what you want.

Kriechi commented 10 years ago

@ysbaddaden splitted - actually 4 commits. I you the things you want don't merge - let me know, then I reorder them appropriately.

ysbaddaden commented 10 years ago

Awesome! I cherry-picked 66580c8 and f2b2ef7 and fixed the one occurence of set -e that was after a newline.

AFAIK [] used to call test but shells eventually made it builtin for performance reasons, just like [[]] which comes with some differences. At least that's what I understood (I may be wrong).