Check for Erlang before proceeding

This commit is contained in:
Craig Everett 2020-01-20 17:14:40 +09:00
parent f35cde997e
commit 2bea70c48d
3 changed files with 18 additions and 4 deletions

22
install
View File

@ -6,6 +6,15 @@ bin="$HOME"/bin
cd "$(dirname $(realpath $0))" cd "$(dirname $(realpath $0))"
chmod +x uninstall chmod +x uninstall
if erl=$(command -v erl)
then
echo "Erlang found at $erl"
else
echo "Could not find an Erlang installation!"
echo "Erlang must be installed and available in \$PATH to proceed."
exit 95
fi
if [ -d "$zomp_dir" ] if [ -d "$zomp_dir" ]
then then
echo "Installation directory $zomp_dir already exists. Aborting." echo "Installation directory $zomp_dir already exists. Aborting."
@ -28,12 +37,17 @@ fi
for rc in "$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile" for rc in "$HOME/.profile" "$HOME/.bashrc" "$HOME/.bash_profile"
do do
if grep -q "PATH=\"\$HOME/bin:\$PATH\"" "$rc" if [ -f "$rc" ]
then then
echo "Path adjustment found in $rc." if grep -q "PATH=\"\$HOME/bin:\$PATH\"" "$rc"
then
echo "Path adjustment found in $rc."
else
echo "Path adjustment not found in $rc. Adding it."
echo "export PATH=\"\$HOME/bin:\$PATH\"" >> "$rc"
fi
else else
echo "Path adjustment not found in $rc. Adding it." echo "No $rc is present. Skipping."
echo "export PATH=\"\$HOME/bin:\$PATH\"" >> "$rc"
fi fi
done done

BIN
zx-0.9.1.tar.gz Normal file

Binary file not shown.

BIN
zx-0.9.1.tar.xz Normal file

Binary file not shown.