]> Untitled Git - git-webhooks.git/blobdiff - update-godot-builder.sh
Get project name based on current directory
[git-webhooks.git] / update-godot-builder.sh
index d85754ca0776c08fd6e73108893f0cd7c8f6e8fa..86d62ccaa1b7976293d540b4708704cc30a8990a 100755 (executable)
@@ -24,10 +24,11 @@ then
 fi
 
 # --- Upon branch update, build gitweb snapshot URI
-# TODO: get project name based on current directory name
-project_name=wolf-seeking-sheep
-snapshot_uri=https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz
-echo "Snapshot URI - https://git.purplebirdman.com/${project_name}.git/snapshot/${newrev}.tar.gz"
+git_project_name=$(pwd | grep -o '[a-zA-Z0-9-]*\.git')
+echo "Git project name - $git_project_name"
+
+snapshot_uri=https://git.purplebirdman.com/${git_project_name}/snapshot/${newrev}.tar.gz
+echo "Snapshot URI - $snapshot_uri"
 
 # --- Now send request to builder service
 godot_builder_uri=https://godot.purplebirdman.com/hook/make-build-request.lua