mirror of
https://github.com/sortedcord/bootstrap.git
synced 2026-07-23 04:32:49 +05:30
refactor: Linting fixes
This commit is contained in:
@@ -81,6 +81,7 @@ make_temp_dir() {
|
||||
version_lt() {
|
||||
[ "$1" = "$2" ] && return 1
|
||||
local IFS=.
|
||||
# shellcheck disable=SC2206
|
||||
local i ver1=($1) ver2=($2)
|
||||
for ((i=${#ver1[@]}; i<3; i++)); do ver1[i]=0; done
|
||||
for ((i=${#ver2[@]}; i<3; i++)); do ver2[i]=0; done
|
||||
|
||||
@@ -11,6 +11,7 @@ if [ -z "${_LIB_COMMON_SOURCED:-}" ]; then
|
||||
# Assumes common.sh is in the same directory as platform.sh
|
||||
# We resolve the directory of the current script
|
||||
_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=/dev/null
|
||||
. "$_LIB_DIR/common.sh"
|
||||
fi
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ EOF
|
||||
|
||||
for temp_file in "${temp_manifests[@]}"; do
|
||||
if [ -s "$temp_file" ]; then
|
||||
cat "$temp_file" | parse_plugin_manifest >> "$cache_file"
|
||||
parse_plugin_manifest < "$temp_file" >> "$cache_file"
|
||||
fi
|
||||
rm -f "$temp_file"
|
||||
done
|
||||
@@ -131,7 +131,7 @@ run_plugin() {
|
||||
if [ -n "$compat_ver" ]; then
|
||||
local current_ver="0.0.0"
|
||||
if [ -f "$BOOTSTRAP_DIR/VERSION" ]; then
|
||||
current_ver=$(cat "$BOOTSTRAP_DIR/VERSION" | tr -d '[:space:]')
|
||||
current_ver=$(tr -d '[:space:]' < "$BOOTSTRAP_DIR/VERSION")
|
||||
fi
|
||||
if version_lt "$compat_ver" "$current_ver"; then
|
||||
log_warn "Plugin '$plugin_name' is only tested up to bootstrap version $compat_ver (current: $current_ver). It may be incompatible."
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=SC2034
|
||||
# This file is auto-generated by scripts/generate_registry.sh. Do not edit manually.
|
||||
|
||||
declare -A INSTALLERS=(
|
||||
|
||||
@@ -262,7 +262,7 @@ for script in "${SCRIPTS[@]}"; do
|
||||
fi
|
||||
;;
|
||||
fall)
|
||||
local savepoint_name="${1:-}"
|
||||
savepoint_name="${1:-}"
|
||||
if [ -z "$savepoint_name" ]; then
|
||||
log_error "Usage: b fall <savepoint_name>"
|
||||
exit 1
|
||||
@@ -271,7 +271,7 @@ for script in "${SCRIPTS[@]}"; do
|
||||
exit 0
|
||||
;;
|
||||
rb)
|
||||
local target="${1:-}"
|
||||
target="${1:-}"
|
||||
if [ -z "$target" ]; then
|
||||
rollback_bare
|
||||
else
|
||||
@@ -283,7 +283,7 @@ for script in "${SCRIPTS[@]}"; do
|
||||
uninstall_tool "$t"
|
||||
done
|
||||
else
|
||||
local registry_file="$BOOTSTRAP_STATE_DIR/registry.json"
|
||||
registry_file="$BOOTSTRAP_STATE_DIR/registry.json"
|
||||
if [ -f "$registry_file" ] && jq -e --arg t "$target" '.tools | has($t)' "$registry_file" >/dev/null; then
|
||||
uninstall_tool "$target"
|
||||
else
|
||||
|
||||
@@ -9,6 +9,7 @@ _LIB_SHELL_CONFIG_SOURCED=1
|
||||
# Source common utilities if not already loaded
|
||||
if [ -z "${_LIB_COMMON_SOURCED:-}" ]; then
|
||||
_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=/dev/null
|
||||
. "$_LIB_DIR/common.sh"
|
||||
fi
|
||||
|
||||
@@ -170,6 +171,7 @@ create_fd_symlink() {
|
||||
source_bashrc() {
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
log_info "Re-sourcing ~/.bashrc..."
|
||||
# shellcheck source=/dev/null
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user