@@ -168,36 +168,57 @@ __launchpad_update_library_paths() {
168
168
fi
169
169
}
170
170
171
- # Setup global dependencies (only if user has manually created them )
171
+ # Setup global dependencies (from multiple possible locations )
172
172
__launchpad_setup_global_deps() {
173
+ # Check the standard global environment
173
174
local global_env_dir="$HOME/.local/share/launchpad/global"
174
-
175
- # Only activate if user has manually created a global environment
176
175
if [[ -d "$global_env_dir/bin" ]]; then
177
176
__launchpad_update_path "$global_env_dir/bin"
178
177
fi
179
178
if [[ -d "$global_env_dir/sbin" ]]; then
180
179
__launchpad_update_path "$global_env_dir/sbin"
181
180
fi
182
-
183
- # Set up library paths for global dependencies
184
181
if [[ -d "$global_env_dir" ]]; then
185
182
__launchpad_update_library_paths "$global_env_dir"
186
183
fi
184
+
185
+ # Also check for global dependencies from ~/.dotfiles
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
187
198
}
188
199
189
200
# Ensure global dependencies are always in PATH
190
201
__launchpad_ensure_global_path() {
202
+ # Add standard global environment to PATH if it exists
191
203
local global_env_dir="$HOME/.local/share/launchpad/global"
192
-
193
- # Add global environment to PATH if it exists
194
204
if [[ -d "$global_env_dir/bin" ]]; then
195
205
__launchpad_update_path "$global_env_dir/bin"
196
206
fi
197
207
if [[ -d "$global_env_dir/sbin" ]]; then
198
208
__launchpad_update_path "$global_env_dir/sbin"
199
209
fi
200
210
211
+ # Also ensure global dependencies from ~/.dotfiles are in PATH
212
+ local dotfiles_env_pattern="$HOME/.local/share/launchpad/.dotfiles_*"
213
+ for dotfiles_env in $dotfiles_env_pattern; do
214
+ if [[ -d "$dotfiles_env/bin" ]]; then
215
+ __launchpad_update_path "$dotfiles_env/bin"
216
+ fi
217
+ if [[ -d "$dotfiles_env/sbin" ]]; then
218
+ __launchpad_update_path "$dotfiles_env/sbin"
219
+ fi
220
+ done
221
+
201
222
# Always ensure critical system paths are available
202
223
__launchpad_ensure_system_path
203
224
}
0 commit comments