MatchbookLab / local-persist

Create named local volumes that persist in the location(s) you want
MIT License
852 stars 123 forks source link

install.sh stops execution with code 1 after recent commit #97

Open Inspirational-sausage-dog opened 1 year ago

Inspirational-sausage-dog commented 1 year ago

Hello. I downloaded install.sh script using curl to tmp folder like in "Quick Way" portion of readme and its execution fails after recent update.

/tmp/install-software.sh; echo $?                                                                                                                                                                                                                                                                           
/                                                                                                                                                              
1

I believe it has something to do with new bash code from #88 that requires a cloned repository to work

gitDir=$(realpath `dirname $BASH_SOURCE`/..)
echo $gitDir

< .. >

if [[ ! "`which git 2> /dev/null`" == "" ]]; then
    thisGit=`git -C "${gitDir}" config --get remote.origin.url`
    thisGit=${thisGit::-4}
    GITHUB_BINARY_BASE="${thisGit}/releases/download"
    GITHUB_RAW_BASE="${thisGit/github.com/raw.githubusercontent.com}/releases/download"
fi

Since I downloaded only install.sh script as described in the "Quick way", git config --get cannot find remote.origin.url variable and returns code 1.

Because environment variable is set to stop execution of the script after first non-zero code signal, scripts execution fails completely.

Has the policy on installation changed but readme hadn't or is this unexpected behavior?

qvalentin commented 1 year ago

I also get the error: "dirname: missing operand", "Try 'dirname --help' for more information." when running curl -fsSL https://raw.githubusercontent.com/MatchbookLab/local-persist/master/scripts/install.sh | sudo bash. Seems like $BASH_SOURCE does not work with this.

ajax-koloskov-k commented 1 year ago

Hello! There is a problem. I also get the error: "dirname: missing operand" Use "Quick way": curl -fsSL https://raw.githubusercontent.com/MatchbookLab/local-persist/master/scripts/install.sh | sudo bash Who knows how to solve this?