mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 19:37:35 +08:00
fix(update): avoid duplicate safe.directory entries for repo and admin submodule
This commit is contained in:
@@ -10,7 +10,17 @@ if ! command -v git &> /dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config --global --add safe.directory $(pwd)
|
||||
repo_root="$(pwd)"
|
||||
|
||||
add_safe_directory() {
|
||||
local dir="$1"
|
||||
|
||||
git config --global --get-all safe.directory | grep -Fx "$dir" > /dev/null || git config --global --add safe.directory "$dir"
|
||||
}
|
||||
|
||||
add_safe_directory "$repo_root"
|
||||
add_safe_directory "$repo_root/public/assets/admin"
|
||||
|
||||
git fetch --all && git reset --hard origin/master && git pull origin master
|
||||
rm -rf composer.lock composer.phar
|
||||
wget https://github.com/composer/composer/releases/latest/download/composer.phar -O composer.phar
|
||||
|
||||
Reference in New Issue
Block a user