Opravy z macos

This commit is contained in:
lachtan obecny
2026-07-13 06:06:18 +02:00
parent a2441cf23b
commit b3026487f0
5 changed files with 34 additions and 16 deletions

1
bashrc
View File

@@ -22,4 +22,5 @@ source_directory_sh "$HOME/.bashrc.d"
append_path "$LWS/bin"
append_path "$LWS/opt/bin"
set_system_paths
set_uniq_path

View File

@@ -60,6 +60,12 @@ function append_path() {
fi
}
function append_path_to_end() {
local path="$1"
remove_path "$path"
append_path "$path"
}
function append_path_try() {
if [[ -e "$1" ]]; then
append_path "$1"
@@ -79,7 +85,14 @@ function prepend_path_try() {
}
function remove_path() {
PATH=$(path | grep -v "$1" | tr "\n" ":")
PATH=$(path | grep -v "^$1$" | tr "\n" ":")
}
function set_system_paths() {
append_path_to_end /usr/bin
append_path_to_end /bin
append_path_to_end /usr/sbin
append_path_to_end /sbin
}
function uniq_path() {

View File

@@ -1,3 +1,4 @@
if [[ -n "${TERM:-}" ]] && can_run tput; then
# Terminal colors
LWS_RED=$(tput setaf 1)
LWS_GREEN=$(tput setaf 2)
@@ -10,3 +11,4 @@ LWS_PS1_HOST='\h'
LWS_PS1_DIR='\w'
LWS_PS1_TYPE='\$'
LWS_PS1_USER_HOST="${LWS_GREEN}${LWS_PS1_USER}@${LWS_PS1_HOST}${LWS_COLOR_RESET}:${LWS_CYAN}${LWS_PS1_DIR}${LWS_COLOR_RESET}"
fi

View File

@@ -1,9 +1,11 @@
# Homebrew initialization
# Can set BREW_HOME in advance
xlog "Homebrew initialization"
xlog "Homebrew/Linuxbrew initialization"
BREW_LOCATIONS=(
"/opt/homebrew"
"/usr/local/Homebrew"
"$HOME/.local/share/linuxbrew"
"$HOME/.linuxbrew"
"/home/linuxbrew/.linuxbrew"
@@ -28,8 +30,8 @@ if [[ -e "$BREW" ]]; then
eval "$($BREW shellenv)"
PATH="$path_backup"
append_path "$HOMEBREW_PREFIX/bin"
append_path "$HOMEBREW_PREFIX/sbin"
prepend_path "$HOMEBREW_PREFIX/bin"
prepend_path "$HOMEBREW_PREFIX/sbin"
fi
unset BREW

View File

@@ -1,4 +1,4 @@
nop "${SDKMAN_DIR:=$HOME/.sdkman}"
: "${SDKMAN_DIR:=$HOME/.sdkman}"
if [[ -d $SDKMAN_DIR ]]; then
export SDKMAN_DIR
source_try "$SDKMAN_DIR/bin/sdkman-init.sh"