mirror of
https://github.com/YunoHost-Apps/peertube-search-index_ynh.git
synced 2024-09-03 19:56:30 +02:00
35 lines
1.1 KiB
Bash
35 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# COMMON VARIABLES
|
|
#=================================================
|
|
|
|
NODEJS_VERSION=16
|
|
|
|
#=================================================
|
|
# PERSONAL HELPERS
|
|
#=================================================
|
|
|
|
_git_clone_or_pull() {
|
|
repo_dir="$1"
|
|
|
|
upstream_repository=$(ynh_read_manifest --key='.upstream.code')
|
|
upstream_url=$(ynh_read_manifest --key='.resources.sources.main.url')
|
|
upstream_commit=$(echo "$upstream_url" | sed -e "s|^${upstream_repository}/-/archive/\([^/]*\)/.*|\1|")
|
|
|
|
if [ -d "$repo_dir" ]; then
|
|
ynh_exec_as "$app" git -C "$repo_dir" fetch --quiet
|
|
else
|
|
ynh_exec_as "$app" git clone "$upstream_repository" "$repo_dir" --quiet
|
|
fi
|
|
ynh_exec_as "$app" git -C "$repo_dir" checkout "$upstream_commit"
|
|
ynh_exec_as "$app" git -C "$repo_dir" submodule update --init --recursive
|
|
}
|
|
|
|
#=================================================
|
|
# EXPERIMENTAL HELPERS
|
|
#=================================================
|
|
|
|
#=================================================
|
|
# FUTURE OFFICIAL HELPERS
|
|
#=================================================
|