Skip to content

Commit

Permalink
Fix platform case statement for Mac and path tester
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Chang <[email protected]>
  • Loading branch information
amzn-changml authored Feb 9, 2024
1 parent c9a0ee4 commit 009b5c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/promote-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ jobs:
PLATFORM=linux
elif [[ $file == *linux ]]; then
CMAKE_FILE=BuiltInPackages_linux_x86_64.cmake
elif [[ $file == *darwin ]]; then
CMAKE_FILE=BuiltInPackages_mac.cmake
PLATFORM=mac
else
CMAKE_FILE=BuiltInPackages_$PLATFORM.cmake
fi
Expand All @@ -132,8 +135,8 @@ jobs:
# Construct the new line using printf with the detected width
new_line=$(printf "ly_associate_package(PACKAGE_NAME %-*s TARGETS %-27s PACKAGE_HASH %s" $width_before_targets "$file" "$PARTIAL_PACKAGE_NAME" "$hash")
grep -q "$PARTIAL_PACKAGE_NAME" "$FILE_PATH"
if [ $? -eq 0 ]; then
test_path=$(grep -q "$PARTIAL_PACKAGE_NAME" "$FILE_PATH" && echo 0 || echo 1)
if [ $test_path -eq 0 ]; then
sed -i "s|ly_associate_package(PACKAGE_NAME $PARTIAL_PACKAGE_NAME-[^ ]* .*PACKAGE_HASH [a-f0-9]\{64\}|$new_line|g" "$FILE_PATH"
else
echo "$new_line" >> "$FILE_PATH"
Expand Down

0 comments on commit 009b5c9

Please sign in to comment.