Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/gh-action-sdk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2021-08-09 06:34:09 +0300
committerPaul Spooren <mail@aparcar.org>2021-09-27 08:51:57 +0300
commitda3664e703cf27badd2c663858e5eb39a660201c (patch)
tree1b2202fae1fafc4d54907b3d174083755d5cdaa4 /entrypoint.sh
parentef9e481720c4bdf5d37db5da21604de655f4842a (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-xentrypoint.sh11
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 \