Skip to content

Commit

Permalink
Format scripts using shfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Apr 18, 2024
1 parent c8525b8 commit b1306dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ let

programs.rustfmt.enable = true;
programs.nixfmt-rfc-style.enable = true;
programs.shfmt.enable = true;
settings.formatter.shfmt.options = [ "--space-redirects" ];
};

results = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi

echo "Building release artifact for system $system"

nix-build "$root" -A build -o "$tmp/build" >/dev/null
nix-build "$root" -A build -o "$tmp/build" > /dev/null
readarray -t closure < <(nix-store -qR "$tmp/build")
nix-store --export "${closure[@]}" > "$tmp/$system.nar"
gzip "$tmp/$system.nar"
Expand Down
10 changes: 5 additions & 5 deletions scripts/update-github-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trap 'rm -rf "$tmp"' exit

# Use dependency groups to update all dependencies together
# Note that repo is not used because we pass `--local` on the CLI
cat <<EOF > "$tmp/input.yml"
cat << EOF > "$tmp/input.yml"
job:
package-manager: "github_actions"
allowed-updates:
Expand All @@ -39,13 +39,13 @@ job:
EOF

if create_pull_request=$(LOCAL_GITHUB_ACCESS_TOKEN="$githubToken" \
dependabot update --file "$tmp/input.yml" --local "$REPO_ROOT" \
| jq --exit-status 'select(.type == "create_pull_request").data'); then
dependabot update --file "$tmp/input.yml" --local "$REPO_ROOT" |
jq --exit-status 'select(.type == "create_pull_request").data'); then

jq --exit-status --raw-output '."pr-body"' <<< "$create_pull_request"

jq --compact-output '."updated-dependency-files"[]' <<< "$create_pull_request" \
| while read -r fileUpdate; do
jq --compact-output '."updated-dependency-files"[]' <<< "$create_pull_request" |
while read -r fileUpdate; do
file=$(jq --exit-status --raw-output '.name' <<< "$fileUpdate")
# --join-output makes sure to not output a trailing newline
jq --exit-status --raw-output --join-output '.content' <<< "$fileUpdate" > "$REPO_ROOT/$file"
Expand Down

0 comments on commit b1306dd

Please sign in to comment.