Skip to content

Commit 6d828ef

Browse files
committed
chore: wip
1 parent 43f0137 commit 6d828ef

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

packages/launchpad/src/dev/shellcode.ts

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,7 @@ __launchpad_setup_global_deps() {
182182
__launchpad_update_library_paths "$global_env_dir"
183183
fi
184184
185-
# Check for global dependencies from ~/.dotfiles (most common case)
186-
local dotfiles_env_pattern="$HOME/.local/share/launchpad/.dotfiles_*"
187-
for dotfiles_env in $dotfiles_env_pattern; do
188-
if [[ -d "$dotfiles_env/bin" ]]; then
189-
__launchpad_update_path "$dotfiles_env/bin"
190-
fi
191-
if [[ -d "$dotfiles_env/sbin" ]]; then
192-
__launchpad_update_path "$dotfiles_env/sbin"
193-
fi
194-
if [[ -d "$dotfiles_env" ]]; then
195-
__launchpad_update_library_paths "$dotfiles_env"
196-
fi
197-
done
198-
199-
# Also check for any other manually activated global dependency environments
185+
# First, check for any other manually activated global dependency environments
200186
# Use launchpad to detect environments created with global: true flag
201187
local launchpad_envs_dir="$HOME/.local/share/launchpad"
202188
if [[ -d "$launchpad_envs_dir" ]] && command -v ${launchpadBinary} >/dev/null 2>&1; then
@@ -228,6 +214,21 @@ __launchpad_setup_global_deps() {
228214
fi
229215
done
230216
fi
217+
218+
# Then check for global dependencies from ~/.dotfiles (highest priority)
219+
# These should come AFTER other global envs so they appear FIRST in PATH
220+
local dotfiles_env_pattern="$HOME/.local/share/launchpad/.dotfiles_*"
221+
for dotfiles_env in $dotfiles_env_pattern; do
222+
if [[ -d "$dotfiles_env/bin" ]]; then
223+
__launchpad_update_path "$dotfiles_env/bin"
224+
fi
225+
if [[ -d "$dotfiles_env/sbin" ]]; then
226+
__launchpad_update_path "$dotfiles_env/sbin"
227+
fi
228+
if [[ -d "$dotfiles_env" ]]; then
229+
__launchpad_update_library_paths "$dotfiles_env"
230+
fi
231+
done
231232
}
232233
233234
# Ensure global dependencies are always in PATH
@@ -241,18 +242,7 @@ __launchpad_ensure_global_path() {
241242
__launchpad_update_path "$global_env_dir/sbin"
242243
fi
243244
244-
# Ensure global dependencies from ~/.dotfiles are in PATH
245-
local dotfiles_env_pattern="$HOME/.local/share/launchpad/.dotfiles_*"
246-
for dotfiles_env in $dotfiles_env_pattern; do
247-
if [[ -d "$dotfiles_env/bin" ]]; then
248-
__launchpad_update_path "$dotfiles_env/bin"
249-
fi
250-
if [[ -d "$dotfiles_env/sbin" ]]; then
251-
__launchpad_update_path "$dotfiles_env/sbin"
252-
fi
253-
done
254-
255-
# Also ensure any other manually activated global environments are in PATH
245+
# First ensure any other manually activated global environments are in PATH
256246
local launchpad_envs_dir="$HOME/.local/share/launchpad"
257247
if [[ -d "$launchpad_envs_dir" ]]; then
258248
for env_dir in "$launchpad_envs_dir"/*; do
@@ -279,6 +269,17 @@ __launchpad_ensure_global_path() {
279269
done
280270
fi
281271
272+
# Then ensure global dependencies from ~/.dotfiles are in PATH (highest priority)
273+
local dotfiles_env_pattern="$HOME/.local/share/launchpad/.dotfiles_*"
274+
for dotfiles_env in $dotfiles_env_pattern; do
275+
if [[ -d "$dotfiles_env/bin" ]]; then
276+
__launchpad_update_path "$dotfiles_env/bin"
277+
fi
278+
if [[ -d "$dotfiles_env/sbin" ]]; then
279+
__launchpad_update_path "$dotfiles_env/sbin"
280+
fi
281+
done
282+
282283
# Always ensure critical system paths are available
283284
__launchpad_ensure_system_path
284285
}

0 commit comments

Comments
 (0)