Skip to content

Commit

Permalink
Fix bash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn committed Sep 15, 2023
1 parent f54984a commit 5dbacec
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ function GetFile {
echo "File '$path' already exists. Skipping download"
return 0
else
rm -rf $path
rm -rf "$path"
fi
fi

if [[ -f $uri ]]; then
echo "'$uri' is a file path, copying file to '$path'"
cp $uri $path
cp "$uri" "$path"
return $?
fi

echo "Downloading $uri"
# Use aria2c if available, otherwise use curl
if command -v aria2c > /dev/null; then
aria2c -q -d $(dirname $path) -o $(basename $path) "$uri"
aria2c -q -d "$(dirname $path)" -o "$(basename $path)" "$uri"

Check notice on line 30 in tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh:30:29: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 30 in tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh#L30 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh:30:52: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
else
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail

Check notice on line 32 in tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh#L32 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh:32:30: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check notice on line 32 in tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh#L32 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/scripts/install_deps.sh:32:62: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi
Expand All @@ -38,9 +38,10 @@ mkdir -p /tmp/src

cd /tmp/src

CPU_ARCH=$(uname -m)
echo "Installing cmake"
GetFile https://github.com/Kitware/CMake/releases/download/v3.27.3/cmake-3.27.3-linux-`uname -m`.tar.gz /tmp/src/cmake-3.27.3-linux-`uname -m`.tar.gz
tar -zxf /tmp/src/cmake-3.27.3-linux-`uname -m`.tar.gz --strip=1 -C /usr
GetFile "https://github.com/Kitware/CMake/releases/download/v3.27.3/cmake-3.27.3-linux-$CPU_ARCH.tar.gz" "/tmp/src/cmake.tar.gz"
tar -zxf /tmp/src/cmake.tar.gz --strip=1 -C /usr

echo "Installing Ninja"
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
Expand All @@ -52,7 +53,7 @@ mv ./build-cmake/ninja /usr/bin
popd

echo "Installing Node.js"
CPU_ARCH=`uname -m`

if [[ "$CPU_ARCH" = "x86_64" ]]; then
NODEJS_ARCH=x64
elif [[ "$CPU_ARCH" = "aarch64" ]]; then
Expand Down

0 comments on commit 5dbacec

Please sign in to comment.