Skip to content

Commit 90e0b17

Browse files
eljogCopilot
andauthored
Setup post-commit hook to withstand template based creations (#102)
Setup post-commit on postCreateCommand, because git directory may be reset if when the repo is used as template --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7df2230 commit 90e0b17

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.devcontainer/postStartCommand.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ supervisord
2222
supervisorctl reread
2323
supervisorctl update
2424

25-
# Run the build script to perform a one-time build for static preview
25+
# Set up post-commit hook and also run the build script to perform a one-time build for static preview
26+
ln -fs /usr/local/bin/post-commit .git/hooks/post-commit
2627
/usr/local/bin/static-preview-build.sh

.devcontainer/refreshTools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sudo cp ./spark-sdk-dist/proxy.js /workspaces/proxy.js
4545
sudo mv ./spark-sdk-dist/proxy.js /usr/local/bin/proxy.js
4646
sudo mv ./spark-sdk-dist/spark.package.json /workspaces/spark.package.json
4747
sudo mv ./spark-sdk-dist/static-preview-build.sh /usr/local/bin/static-preview-build.sh
48-
sudo mv ./spark-sdk-dist/post-commit ${WORKSPACE_DIR}/.git/hooks/post-commit
48+
sudo mv ./spark-sdk-dist/post-commit /usr/local/bin/post-commit
4949

5050
# Upgrade the Spark Tools package
5151
if [ -f "$TOOLS_MARKER_FILE" ] && [ "$(cat "$TOOLS_MARKER_FILE")" == "$(cat ./spark-sdk-dist/spark-tools-version)" ]; then

0 commit comments

Comments
 (0)