From 009b5c993095a7c279568d252163276146dbae8f Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Fri, 9 Feb 2024 15:18:11 -0800 Subject: [PATCH] Fix platform case statement for Mac and path tester Signed-off-by: Mike Chang --- .github/workflows/promote-packages.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/promote-packages.yaml b/.github/workflows/promote-packages.yaml index ae53b995..3fef363d 100644 --- a/.github/workflows/promote-packages.yaml +++ b/.github/workflows/promote-packages.yaml @@ -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 @@ -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"