Hi,,
So I wanted to try out this package and ran into a problem with the Makefile. Specifically, make install runs sed -i.bak 's|SCRIPT_DIR.*|SPINNERS_JSON="/usr/local/share/bash-cli-spinners/spinners.json"|' /usr/local/bin/spinner.
I'm not exactly sure what change this command was intended to make, but in its current state, the sed command modifies the copy of spinner.sh in /usr/local/bin/spinner such that these two lines
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
|
SPINNERS_JSON="$SCRIPT_DIR/spinners.json" |
change into
SPINNERS_JSON="/usr/local/share/bash-cli-spinners/spinners.json"
SPINNERS_JSON="$SPINNERS_JSON="/usr/local/share/bash-cli-spinners/spinners.json"
...which isn't syntactically correct (causing the script to abort before it does anything) and can't be what was intended. (Maybe there was an earlier version of spinner.sh where the replacement regex did what was intended?
While I'm not 100% sure what the author was going for, if it helps, here are two possible ways to make the script work:
-
Remove the sed command from the Makefile and replace the SCRIPT_DIR=... line in spinner.sh with
for SCRIPT_DIR in "$(dirname "${BASH_SOURCE[0]}")" /usr/local/share/bash-cli-spinners; do
[ -f "${SCRIPT_DIR}/spinners.json" ] && break
done
-
Change the sed command to something like
sed -i.bak 's|^\s*SCRIPT_DIR=.*$$|SCRIPT_DIR="/usr/local/share/bash-cli-spinners"|' /usr/local/bin/spinner
(Note: the $$ is how you escape a $ in a Makefile)
Hi,,
So I wanted to try out this package and ran into a problem with the
Makefile. Specifically,make installrunssed -i.bak 's|SCRIPT_DIR.*|SPINNERS_JSON="/usr/local/share/bash-cli-spinners/spinners.json"|' /usr/local/bin/spinner.I'm not exactly sure what change this command was intended to make, but in its current state, the
sedcommand modifies the copy ofspinner.shin/usr/local/bin/spinnersuch that these two linesbash-cli-spinners/spinner.sh
Lines 9 to 10 in 79434c5
change into
...which isn't syntactically correct (causing the script to abort before it does anything) and can't be what was intended. (Maybe there was an earlier version of
spinner.shwhere the replacement regex did what was intended?While I'm not 100% sure what the author was going for, if it helps, here are two possible ways to make the script work:
Remove the
sedcommand from theMakefileand replace theSCRIPT_DIR=...line inspinner.shwithChange the sed command to something like
sed -i.bak 's|^\s*SCRIPT_DIR=.*$$|SCRIPT_DIR="/usr/local/share/bash-cli-spinners"|' /usr/local/bin/spinner(Note: the
$$is how you escape a$in aMakefile)