Migrate pre-commit.entrypoint.sh to POSIX sh (#5540)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
The script was basically posix with a bashism. POSIX sh is lighter and thus better. Reviewed-on: #5540 Reviewed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5540.
This commit is contained in:
@@ -45,4 +45,4 @@ COPY pre-commit.entrypoint.sh ./
|
||||
# Set the workdir
|
||||
WORKDIR /website-source
|
||||
|
||||
ENTRYPOINT ["bash", "/website-source-during-build/pre-commit.entrypoint.sh"]
|
||||
ENTRYPOINT ["sh", "/website-source-during-build/pre-commit.entrypoint.sh"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Get the changed files
|
||||
target_branch="${1:-master}"
|
||||
@@ -8,7 +8,7 @@ files="$(git diff --name-only "$source_branch" "$target_branch")"
|
||||
files_args=""
|
||||
for file in $files; do
|
||||
if [ -f "$file" ]; then
|
||||
files_args+="--file $file "
|
||||
files_args="$files_args --file $file"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user