Skip to content

Commit

Permalink
Merge pull request #44 from lilyLuLiu/fix-install
Browse files Browse the repository at this point in the history
fix crc-support run.sh script extra popd
  • Loading branch information
lilyLuLiu authored Nov 12, 2024
2 parents 2263957 + 5f54918 commit 5ce3917
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion crc-support/oci/lib/linux/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ check_download() {

# $1 file name for crc installer
installCRC() {
sudo tar xvf "${1}" --strip-components 1 -C /usr/local/bin/
if [[ ${1} == *.tar.xz ]]; then
sudo tar xvf "${1}" --strip-components 1 -C /usr/local/bin/
else
sudo cp ${1} /usr/local/bin/
fi
}
11 changes: 6 additions & 5 deletions crc-support/oci/lib/unix/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ fi
if [[ $freshEnv == 'true' ]]; then
echo "removing previous crc"
force_fresh_environment
fi
fi

mkdir -p $targetPath
pushd $targetPath

# DOWNLOAD
if [[ $download == "true" ]]; then
echo "downlading $aName"
mkdir -p $targetPath
pushd $targetPath

# Download sha256sum
curl --insecure -LO "$aBaseURL/$aSHAName"
# Check if require download
Expand All @@ -102,8 +104,7 @@ if [[ $download == "true" ]]; then
dURL="$aBaseURL/$aName"
download $dURL
check_download $aName $aSHAName
if [[ ${?} -ne 0 ]]; then
popd
if [[ ${?} -ne 0 ]]; then
echo "Error with downloading $aName"
exit 1
fi
Expand Down

0 comments on commit 5ce3917

Please sign in to comment.