-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e5744f
commit a99c80c
Showing
1 changed file
with
37 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,12 @@ structlog_url="https://github.com/Tastyep/structlog.nvim.git" | |
|
||
declare -xr NVIM_APPNAME="${NVIM_APPNAME:-"qvim"}" | ||
|
||
#Set branch to master unless specified by the user | ||
declare -x QV_BRANCH="${QV_BRANCH:-"main"}" | ||
declare -xr QV_REMOTE="${QV_REMOTE:-"quantumfate/qvim.git"}" | ||
declare -xr QV_REMOTE="${QV_REMOTE:-"QuantumVim/QuantumVim.git"}" | ||
|
||
declare -xr QV_CONFIG_BRANCH="${QV_CONFIG_BRANCH:-"main"}" | ||
declare -xr QV_CONFIG_REMOTE="${QV_CONFIG_REMOTE:-"QuantumVim/config.git"}" | ||
|
||
declare -xr INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}" | ||
|
||
declare -xr XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" | ||
|
@@ -42,6 +45,21 @@ declare ARGS_OVERWRITE=0 | |
declare ADDITIONAL_WARNINGS="" | ||
declare USE_SSH=0 | ||
|
||
declare -a __qvim_remotes=( | ||
"$QV_REMOTE" | ||
"$QV_CONFIG_REMOTE" | ||
) | ||
|
||
declare -a __qvim_branches=( | ||
"$QV_BRANCH" | ||
"$QV_CONFIG_BRANCH" | ||
) | ||
|
||
declare -a __qvim_destinations=( | ||
"$QUANTUMVIM_RTP_DIR" | ||
"$QUANTUMVIM_CONFIG_DIR" | ||
) | ||
|
||
declare -a __qvim_dirs=( | ||
"$QUANTUMVIM_STATE_DIR" | ||
"$QUANTUMVIM_CACHE_DIR" | ||
|
@@ -274,22 +292,28 @@ function verify_qvim_dirs() { | |
} | ||
|
||
function clone_qvim() { | ||
msg "Cloning QuantumVim configuration" | ||
msg "Cloning QuantumVim Repositories" | ||
|
||
if [ "$USE_SSH" -eq 0 ]; then | ||
for scope in "${!__qvim_remotes[@]}"; do | ||
local repo="${__qvim_remotes[$scope]}" | ||
local branch="${__qvim_branches[$scope]}" | ||
local destination="${__qvim_destinations[$scope]}" | ||
local method="" | ||
|
||
if ! git clone --branch "$QV_BRANCH" \ | ||
"https://github.com/${QV_REMOTE}" "$QUANTUMVIM_RTP_DIR"; then | ||
echo "Failed to clone repository. Installation failed." | ||
exit 1 | ||
__backup_dir "$destination" | ||
|
||
if [ "$USE_SSH" -eq 0 ]; then | ||
method="https://github.com/" | ||
else | ||
method="[email protected]:/" | ||
fi | ||
else | ||
if ! git clone --branch "$QV_BRANCH" \ | ||
"[email protected]:${QV_REMOTE}" "$QUANTUMVIM_RTP_DIR"; then | ||
echo "Failed to clone repository. Installation failed." | ||
if ! git clone --branch "$branch" \ | ||
"${method}${repo}" "$destination"; then | ||
echo "Failed to clone repository '${repo}'. Installation failed." | ||
exit 1 | ||
fi | ||
fi | ||
msg "Cloned $repo to $destination" | ||
done | ||
} | ||
|
||
function setup_exec() { | ||
|