azukiapp/azk

Remove bashisms from `shared/scripts/install.sh` script

Closed this issue · 5 comments

The easiest way to install azk is by running shared/scripts/install.sh script, which can be accessible via http://azk.io/install.sh

In azk docs, there are instructions to download the script and pipe it to bash, since the script is intended to be run using bash (you can see #!/bin/bash on its first line).

However, if the user pipes it to any other shell (| sh, as instance), it'll break due to syntax error.
To fix it, all bashisms have to be removed from the installation script.

Plus, the documentation have to be updated in order to indicate the use of sh as the shell to be used.

Good proposal, but I think important to note a few things:

  • azk requires bash for execution. The script ./bin/azk have many bashisms;
  • one of the most important steps of the script ./bin/azk is the resolution step of azk path, which uses the variable BASH_SOURCE, so you must be careful in their modification;

A good reference on these issues is that script, used by the team http://basho.com in packaging their products based Erlang.

@nuxlli Good points! I personally don't think it's bad to keep bin/azk using bash. That's pretty ok, once the user doesn't have to worry about it. Imho, bin/azk can be kept as it is.

My point is regard the installation script (shared/scripts/install.sh). It has to be piped into a shell. In azk docs, bash is used. But there are no guarantees that the user will pipe it into some other shell. And would be great if it worked, not a creepy syntax error be popped in screen, do you agree?

Yep, that makes sense.

For now I think we can focus on improving the install.sh script, but keep open the idea of making ./bin/azk more agnostic.

Cool! :)