mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
More simplification for git upgrade
This commit is contained in:
parent
7e2d35b031
commit
21a9900e7c
1 changed files with 14 additions and 21 deletions
|
@ -110,39 +110,32 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]; then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=3
|
||||
|
||||
# If current install is not a Git repo then init one
|
||||
|
||||
pushd "$final_path"
|
||||
if [ ! `git rev-parse --is-inside-work-tree &> /dev/null` ]; then
|
||||
git init --quiet
|
||||
git remote add origin $repo_url
|
||||
git fetch origin --quiet
|
||||
git checkout -b stable --track origin/stable --force --quiet
|
||||
# If current install is not a Git repo then init one
|
||||
git init --quiet
|
||||
git remote add origin $repo_url
|
||||
git fetch origin --quiet
|
||||
git checkout -b stable --track origin/stable --force --quiet
|
||||
fi
|
||||
git fetch --quiet
|
||||
git checkout stable --quiet
|
||||
git pull --quite
|
||||
git reset --hard $version_commit --quiet
|
||||
popd
|
||||
|
||||
pushd "$final_path/addon"
|
||||
if [ ! `git rev-parse --is-inside-work-tree &> /dev/null` ]; then
|
||||
git init --quiet
|
||||
git remote add origin $addons_repo_url
|
||||
git fetch origin --quiet
|
||||
git checkout -b stable --track origin/stable --force --quiet
|
||||
git remote add origin $addons_repo_url
|
||||
git fetch origin --quiet
|
||||
git checkout -b stable --track origin/stable --force --quiet
|
||||
fi
|
||||
popd
|
||||
|
||||
# Update through Git
|
||||
pushd "$final_path"
|
||||
git fetch --quiet
|
||||
git checkout stable --quiet
|
||||
git pull --quiet
|
||||
git reset --hard $version_commit --quiet
|
||||
popd
|
||||
|
||||
pushd "$final_path/addon"
|
||||
git fetch --quiet
|
||||
git checkout stable --quiet
|
||||
git pull --quiet
|
||||
git reset --hard $addons_version_commit --quiet
|
||||
git reset --quiet --hard $addons_version_commit
|
||||
popd
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue