Skip to content

Commit

Permalink
add env support
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Mar 21, 2024
1 parent 8b43413 commit d268d83
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ if [ -n "${INPUT_PLATFORMS}" ]; then
done
fi

# Add the Nix and Apt packages if specified
if [ -n "${INPUT_PKGS}" ]; then
read -ra PKGS_ARR <<< "$(echo "$INPUT_PKGS" | tr ',\n' ' ')"
BUILD_CMD="$BUILD_CMD --pkgs '${PKGS_ARR[*]}'"
Expand All @@ -44,6 +43,14 @@ if [ -n "${INPUT_APT}" ]; then
BUILD_CMD="$BUILD_CMD --apt '${APT_ARR[*]}'"
fi

# Include environment variables in the build command
if [ -n "${INPUT_ENV}" ]; then
IFS=',' read -ra ENVS <<< "$INPUT_ENV"
for env_var in "${ENVS[@]}"; do
BUILD_CMD="$BUILD_CMD --env $env_var"
done
fi

# Execute the Nixpacks build command
echo "Executing Nixpacks build command:"
echo "$BUILD_CMD"
Expand Down

0 comments on commit d268d83

Please sign in to comment.