Skip to content

Commit

Permalink
attempt different split
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Mar 21, 2024
1 parent 559607b commit 8b43413
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,34 @@ BUILD_CMD="nixpacks build $INPUT_CONTEXT"

# Incorporate provided input parameters from actions.yml into the Nixpacks build command
if [ -n "${INPUT_TAGS}" ]; then
IFS=', '$'\n' read -ra TAGS <<< "$INPUT_TAGS"
read -ra TAGS <<< "$(echo "$INPUT_TAGS" | tr ',\n' ' ')"
for tag in "${TAGS[@]}"; do
BUILD_CMD="$BUILD_CMD --tag $tag"
done
fi

if [ -n "${INPUT_LABELS}" ]; then
IFS=', '$'\n' read -ra LABELS <<< "$INPUT_LABELS"
read -ra LABELS <<< "$(echo "$INPUT_LABELS" | tr ',\n' ' ')"
for label in "${LABELS[@]}"; do
BUILD_CMD="$BUILD_CMD --label $label"
done
fi

if [ -n "${INPUT_PLATFORMS}" ]; then
IFS=', '$'\n' read -ra PLATFORMS <<< "$INPUT_PLATFORMS"
read -ra PLATFORMS <<< "$(echo "$INPUT_PLATFORMS" | tr ',\n' ' ')"
for platform in "${PLATFORMS[@]}"; do
BUILD_CMD="$BUILD_CMD --platform $platform"
done
fi

# Add the Nix and Apt packages if specified
if [ -n "${INPUT_PKGS}" ]; then
# Using an array to avoid issues if there are spaces in the input
IFS=', '$'\n' read -ra PKGS_ARR <<< "$INPUT_PKGS"
read -ra PKGS_ARR <<< "$(echo "$INPUT_PKGS" | tr ',\n' ' ')"
BUILD_CMD="$BUILD_CMD --pkgs '${PKGS_ARR[*]}'"
fi

if [ -n "${INPUT_APT}" ]; then
# Using an array to avoid issues if there are spaces in the input
IFS=', '$'\n' read -ra APT_ARR <<< "$INPUT_APT"
read -ra APT_ARR <<< "$(echo "$INPUT_APT" | tr ',\n' ' ')"
BUILD_CMD="$BUILD_CMD --apt '${APT_ARR[*]}'"
fi

Expand Down

0 comments on commit 8b43413

Please sign in to comment.