mirror of
https://github.com/DeterminateSystems/update-flake-lock.git
synced 2025-04-21 01:10:17 +03:00
22 lines
567 B
Bash
Executable file
22 lines
567 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
|
|
cd "$PATH_TO_FLAKE_DIR"
|
|
fi
|
|
|
|
commitArg=""
|
|
if [[ "$COMMIT_WITH_TOKEN" != "true" ]]; then
|
|
# Commit happening in next step
|
|
commitArg="suppress"
|
|
fi
|
|
|
|
if [[ -n "$TARGETS" ]]; then
|
|
inputs=()
|
|
for input in $TARGETS; do
|
|
inputs+=("--update-input" "$input")
|
|
done
|
|
nix flake lock "${inputs[@]}" ${commitArg:+"--commit-lock-file"} --commit-lockfile-summary "$COMMIT_MSG"
|
|
else
|
|
nix flake update ${commitArg:+"--commit-lock-file"} --commit-lockfile-summary "$COMMIT_MSG"
|
|
fi
|