-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v2' of https://github.com/maxheld83/muggle into v2
- Loading branch information
Showing
3 changed files
with
24 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Check if we are in a submodule | ||
if git rev-parse --show-superproject-working-tree > /dev/null 2>&1; then | ||
# We're in a submodule. Get the submodule's working directory | ||
SUBMODULE_ROOT="$(git rev-parse --show-toplevel)" | ||
else | ||
# We're in a normal repo | ||
SUBMODULE_ROOT="$(pwd)" | ||
fi | ||
|
||
# Path to install.sh relative to the repo/submodule root | ||
INSTALL_SCRIPT="$SUBMODULE_ROOT/install.sh" | ||
|
||
# Check if install.sh exists and is executable | ||
if [ -x "$INSTALL_SCRIPT" ]; then | ||
# Run the install script with the arguments passed to the hook | ||
"$INSTALL_SCRIPT" "$@" | ||
else | ||
echo "Warning: install.sh not found or not executable at $INSTALL_SCRIPT" >&2 | ||
fi |