diff options
author | Rosen Penev <rosenp@gmail.com> | 2021-08-09 06:34:09 +0300 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-09-27 08:51:57 +0300 |
commit | da3664e703cf27badd2c663858e5eb39a660201c (patch) | |
tree | 1b2202fae1fafc4d54907b3d174083755d5cdaa4 /entrypoint.sh | |
parent | ef9e481720c4bdf5d37db5da21604de655f4842a (diff) |
run init scripts through shfmt
Based on the quilt check above.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'entrypoint.sh')
-rwxr-xr-x | entrypoint.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh index 8a9f8c6..dedcbda 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -78,6 +78,17 @@ else exit 1 fi fi + + FILES_DIR=$(find "$GITHUB_WORKSPACE" -path "*/$PKG/files") + if [ -d "$FILES_DIR" ] && [ -z "$NO_SHFMT_CHECK" ]; then + find "$FILES_DIR" -name "*.init" -exec shfmt -w -sr -s '{}' \; + if ! git -C "$FILES_DIR" diff --quiet -- .; then + echo "init script must be formatted. Please run through shfmt -w -sr -s" + git -C "$FILES_DIR" checkout -- . + exit 1 + fi + fi + done make \ |