Skip to content

Commit

Permalink
Fix OH 5.0 install
Browse files Browse the repository at this point in the history
Ignore archive name and strip off the first part, so we can ignore the
upstream folder name.

Signed-off-by: Jonathan Schwender <[email protected]>
  • Loading branch information
jschwe committed Oct 6, 2024
1 parent c83ee0e commit 1ded869
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions install_ohos_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,20 @@ if [[ "${MIRROR_DOWNLOAD_SUCCESS}" != "true" ]]; then
curl --fail -L -O "${DOWNLOAD_URL}.sha256"
fi

VERSION_MAJOR=${INPUT_VERSION%%.*}

if [[ "${OS}" == "mac" ]]; then
echo "$(cat "${OS_FILENAME}".sha256) ${OS_FILENAME}" | shasum -a 256 --check --status
tar -xf "${OS_FILENAME}" --strip-components=2
tar -xf "${OS_FILENAME}" --strip-components=3
else
echo "$(cat "${OS_FILENAME}".sha256) ${OS_FILENAME}" | sha256sum --check --status
tar -xf "${OS_FILENAME}"
if (( VERSION_MAJOR >= 5 )); then
tar -xf "${OS_FILENAME}"
else
tar -xf "${OS_FILENAME}" --strip-components=1
fi
fi
rm "${OS_FILENAME}" "${OS_FILENAME}.sha256"
cd ohos-sdk
echo "sdk-path=$PWD" >> "${GITHUB_OUTPUT}"

if [[ "${OS}" == "linux" ]]; then
Expand Down

0 comments on commit 1ded869

Please sign in to comment.