-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cleanup and minor syntax improvements (#1217)
* chore: cleanup and minor syntax improvements This commit mainly tackled several minor touch-ups and syntax improvements: - Addressed `luacheck` issues from previous commits. - Added some to-do comments for `_buf_vtext`. - Eliminated redundant/outdated options. - Temporarily removed the ability to install nightly-version configs and updated the names of relevant functions: - `clone_by_https_or_ssh` -> `clone_repo` - Rewrote `dotstutor` to make it more readable. * perf(debugpy): simplify venv detection logic * fixup! chore: cleanup and minor syntax improvements * fixup! Merge branch 'main' into chore/cleanups
- Loading branch information
Showing
9 changed files
with
156 additions
and
165 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 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 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 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 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 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 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,7 +8,6 @@ Set-StrictMode -Version 3.0 | |
$ErrorActionPreference = "Stop" # Exit when command fails | ||
|
||
# global-scope vars | ||
$REQUIRED_NVIM_VERSION_NIGHTLY = [version]'0.10' | ||
$REQUIRED_NVIM_VERSION = [version]'0.9.0' | ||
$REQUIRED_NVIM_VERSION_LEGACY = [version]'0.8.0' | ||
$USE_SSH = $True | ||
|
@@ -21,7 +20,6 @@ $installer_pkg_matrix = @{ "NodeJS" = "npm"; "Python" = "pip"; "Ruby" = "gem" } | |
# env vars | ||
$env:XDG_CONFIG_HOME ??= $env:LOCALAPPDATA | ||
$env:CCPACK_MGR ??= 'unknown' | ||
$env:CCLONE_BRANCH_NIGHTLY ??= '0.10' | ||
$env:CCLONE_BRANCH ??= 'main' | ||
$env:CCLONE_BRANCH_LEGACY ??= '0.8' | ||
$env:CCLONE_ATTR ??= 'undef' | ||
|
@@ -285,15 +283,13 @@ function check_nvim_version ([Parameter(Mandatory = $True)][ValidateNotNullOrEmp | |
return ($nvim_version -ge $RequiredVersionMin) | ||
} | ||
|
||
function clone_by_https_or_ssh ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$CloneUrl) { | ||
if ((check_nvim_version -RequiredVersionMin $REQUIRED_NVIM_VERSION_NIGHTLY)) { | ||
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH_NIGHTLY" "$env:CCLONE_ATTR" $CloneUrl "$env:CCDEST_DIR" } | ||
} elseif ((check_nvim_version -RequiredVersionMin $REQUIRED_NVIM_VERSION)) { | ||
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH" "$env:CCLONE_ATTR" $CloneUrl "$env:CCDEST_DIR" } | ||
function clone_repo ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$WithURL) { | ||
if ((check_nvim_version -RequiredVersionMin $REQUIRED_NVIM_VERSION)) { | ||
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH" "$env:CCLONE_ATTR" $WithURL "$env:CCDEST_DIR" } | ||
} elseif ((check_nvim_version -RequiredVersionMin $REQUIRED_NVIM_VERSION_LEGACY)) { | ||
warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION)." | ||
info -Msg "Automatically redirecting you to the latest compatible version..." | ||
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH_LEGACY" "$env:CCLONE_ATTR" $CloneUrl "$env:CCDEST_DIR" } | ||
safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH_LEGACY" "$env:CCLONE_ATTR" $WithURL "$env:CCDEST_DIR" } | ||
} else { | ||
warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION_LEGACY)." | ||
_abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -Info_msg @" | ||
|
@@ -375,9 +371,9 @@ You must install Git before installing this Nvim config. See: | |
info -Msg "Fetching in progress..." | ||
|
||
if ($USE_SSH) { | ||
clone_by_https_or_ssh '[email protected]:ayamir/nvimdots.git' | ||
clone_repo -WithURL '[email protected]:ayamir/nvimdots.git' | ||
} else { | ||
clone_by_https_or_ssh 'https://github.com/ayamir/nvimdots.git' | ||
clone_repo -WithURL 'https://github.com/ayamir/nvimdots.git' | ||
} | ||
|
||
safe_execute -WithCmd { Set-Location -Path "$env:CCDEST_DIR" } | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ set -u | |
DEST_DIR="${HOME}/.config/nvim" | ||
BACKUP_DIR="${DEST_DIR}_backup-$(date +%Y%m%dT%H%M%S)" | ||
CLONE_ATTR=("--progress") | ||
REQUIRED_NVIM_VERSION_NIGHTLY=0.10 | ||
REQUIRED_NVIM_VERSION=0.9.0 | ||
REQUIRED_NVIM_VERSION_LEGACY=0.8.0 | ||
USE_SSH=1 | ||
|
@@ -170,10 +169,8 @@ check_nvim_version() { | |
fi | ||
} | ||
|
||
clone_by_https_or_ssh() { | ||
if check_nvim_version "${REQUIRED_NVIM_VERSION_NIGHTLY}"; then | ||
execute "git" "clone" "-b" "0.10" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}" | ||
elif check_nvim_version "${REQUIRED_NVIM_VERSION}"; then | ||
clone_repo() { | ||
if check_nvim_version "${REQUIRED_NVIM_VERSION}"; then | ||
execute "git" "clone" "-b" "main" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}" | ||
elif check_nvim_version "${REQUIRED_NVIM_VERSION_LEGACY}"; then | ||
warn "You have outdated Nvim installed (< ${REQUIRED_NVIM_VERSION})." | ||
|
@@ -273,9 +270,9 @@ fi | |
|
||
info "Fetching in progress..." | ||
if [[ "${USE_SSH}" -eq "1" ]]; then | ||
clone_by_https_or_ssh "[email protected]:ayamir/nvimdots.git" | ||
clone_repo "[email protected]:ayamir/nvimdots.git" | ||
else | ||
clone_by_https_or_ssh "https://github.com/ayamir/nvimdots.git" | ||
clone_repo "https://github.com/ayamir/nvimdots.git" | ||
fi | ||
|
||
cd "${DEST_DIR}" || return | ||
|
Oops, something went wrong.