-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry.zsh
More file actions
executable file
·217 lines (180 loc) · 11.4 KB
/
entry.zsh
File metadata and controls
executable file
·217 lines (180 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/usr/bin/env zsh
# ==============================================================================
# OSA Scripts Entry Point
# ==============================================================================
# This script loads aliases and plugins based on the OSA configuration.
# Configuration flags are already injected by OSA setup (from ~/.osa-config).
# Do NOT source ~/.osa-config here - it's already in the environment!
#
# Part of: https://github.com/VirtualizeLLC/osa
# ==============================================================================
# Get the directory where this script is located
# This is the root of the osa-scripts repository
export OSA_SCRIPTS_ROOT="${0:A:h}"
export OSA_SCRIPTS_ZSH_ROOT="$OSA_SCRIPTS_ROOT/zsh"
# ==============================================================================
# PLATFORM DETECTION
# ==============================================================================
# Load platform detection utilities
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/detect-platform.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/detect-platform.zsh"
# ==============================================================================
# ALIASES
# ==============================================================================
# Git Aliases
if [[ "${OSA_CONFIG_COMPONENTS_GIT}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/git.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/git.zsh"
fi
# Node.js Aliases (load if Node is enabled in components OR if runtimes.node is enabled)
if [[ "${OSA_CONFIG_COMPONENTS_NODE}" == "true" ]] || [[ "${OSA_CONFIG_RUNTIMES_NODE_ENABLED}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/node.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/node.zsh"
fi
# NPM Aliases
if [[ "${OSA_CONFIG_COMPONENTS_NODE}" == "true" ]] || [[ "${OSA_CONFIG_RUNTIMES_NODE_ENABLED}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/npm.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/npm.zsh"
fi
# Yarn Aliases
if [[ "${OSA_CONFIG_COMPONENTS_NODE}" == "true" ]] || [[ "${OSA_CONFIG_RUNTIMES_NODE_ENABLED}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/yarn.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/aliases/development/yarn.zsh"
fi
# OSA Aliases (always load)
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/aliases/system/osa.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/aliases/system/osa.zsh"
# ==============================================================================
# AUTHORIZATION & SECRETS
# ==============================================================================
# Secrets Management (always load if exists)
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/authorization/secrets.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/authorization/secrets.zsh"
# ==============================================================================
# PLUGINS - CORE UTILITIES
# ==============================================================================
# ANSI Colors (always load)
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/core/ansi-colors.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/core/ansi-colors.zsh"
# Oh My Zsh Config
if [[ "${OSA_CONFIG_COMPONENTS_OH_MY_ZSH}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/core/oh-my-zsh-config.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/core/oh-my-zsh-config.zsh"
fi
# Powerlevel10k
if [[ "${OSA_CONFIG_COMPONENTS_ZSH_PLUGINS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/core/p10k.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/core/p10k.zsh"
fi
# ==============================================================================
# PLUGINS - TOOLS
# ==============================================================================
# Homebrew
if [[ "${OSA_CONFIG_COMPONENTS_HOMEBREW}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/tools/brew.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/tools/brew.zsh"
fi
# Direnv
if [[ "${OSA_CONFIG_COMPONENTS_DIRENV}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_DIRENV}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/tools/direnv.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/tools/direnv.zsh"
fi
# Keychain
if [[ "${OSA_CONFIG_COMPONENTS_KEYCHAIN}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_KEYCHAIN}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/tools/keychain.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/tools/keychain.zsh"
fi
# Ngrok
if [[ "${OSA_CONFIG_COMPONENTS_NGROK}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_NGROK}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/tools/ngrok.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/tools/ngrok.zsh"
fi
# VS Code
if [[ "${OSA_CONFIG_COMPONENTS_VSCODE}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_VSCODE}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/tools/vscode.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/tools/vscode.zsh"
fi
# ==============================================================================
# PLUGINS - MOBILE & NATIVE DEVELOPMENT
# ==============================================================================
# React Native
if [[ "${OSA_CONFIG_COMPONENTS_REACT_NATIVE}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_REACT_NATIVE}" == "true" ]] || [[ "${OSA_CONFIG_COMPONENTS_ANDROID}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_ANDROID}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/react-native/react-native.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/react-native/react-native.zsh"
fi
# Android Snippets
if [[ "${OSA_CONFIG_COMPONENTS_ANDROID}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_ANDROID}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/android/android-adb.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/android/android-adb.zsh"
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/android/android-emulator.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/android/android-emulator.zsh"
fi
# ==============================================================================
# PLUGINS - macOS SPECIFIC
# ==============================================================================
# macOS Browsers
if [[ "${OSA_CONFIG_COMPONENTS_MAC_TOOLS}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_MAC_TOOLS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/browsers.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/browsers.zsh"
fi
# macOS Deletion Commands
if [[ "${OSA_CONFIG_COMPONENTS_MAC_TOOLS}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_MAC_TOOLS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/deletion-commands.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/deletion-commands.zsh"
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/rmAsync.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/rmAsync.zsh"
fi
# macOS File Descriptor Management
if [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_FILELIMITS}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_FILELIMITS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/set-max-file-limit.sh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/set-max-file-limit.sh"
fi
# macOS eGPU Management
if [[ "${OSA_CONFIG_COMPONENTS_EGPU}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_EGPU}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/egpu.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/egpu.zsh"
fi
# macOS Keystore Requirements
if [[ "${OSA_CONFIG_COMPONENTS_ANDROID}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_ANDROID}" == "true" ]] || [[ "${OSA_CONFIG_COMPONENTS_MAC_TOOLS}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_MAC_TOOLS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/keystore-req.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/keystore-req.zsh"
fi
# macOS Xcode Commands
if [[ "${OSA_CONFIG_COMPONENTS_XCODE}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_XCODE}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/xcode-commands.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/xcode-commands.zsh"
fi
# macOS CocoaPods Nuke
if [[ "${OSA_CONFIG_COMPONENTS_COCOAPODS}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/cocoapods/nuke.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/platform/mac/cocoapods/nuke.zsh"
fi
# ==============================================================================
# PLUGINS - COMPRESSION & UTILITIES
# ==============================================================================
# Parallel bzip2 (pbzip2)
if [[ "${OSA_CONFIG_COMPONENTS_COMPRESSION}" == "true" ]] || [[ "${OSA_CONFIG_SNIPPETS_OSASNIPPETS_COMPRESSION}" == "true" ]]; then
[[ -f "$OSA_SCRIPTS_ZSH_ROOT/compression/tar/pbzip2.zsh" ]] && source "$OSA_SCRIPTS_ZSH_ROOT/compression/tar/pbzip2.zsh"
fi
# ==============================================================================
# CONFIGURATION INFORMATION
# ==============================================================================
# Scripts are loaded based on flags from ~/.osa-config (sourced by OSA setup)
# DO NOT source ~/.osa-config in this script - it's already in the environment!
#
# This script uses relative paths from OSA_SCRIPTS_ROOT (the repo location)
# which is set at the top of this file using ${0:A:h}
#
# Configuration variables use the new OSA_CONFIG_* format:
#
# Component flags (setup components):
# OSA_CONFIG_COMPONENTS_SYMLINKS=true # Symlinks management
# OSA_CONFIG_COMPONENTS_OH_MY_ZSH=true # Oh My Zsh framework
# OSA_CONFIG_COMPONENTS_ZSH_PLUGINS=true # Zsh plugins (syntax highlighting, etc)
# OSA_CONFIG_COMPONENTS_HOMEBREW=true # Homebrew package manager
# OSA_CONFIG_COMPONENTS_MISE=true # Mise version manager
# OSA_CONFIG_COMPONENTS_OSA_SNIPPETS=true # OSA snippets repository
# OSA_CONFIG_COMPONENTS_GIT=true # Git configuration
# OSA_CONFIG_COMPONENTS_COCOAPODS=true # CocoaPods (iOS/React Native)
#
# Snippet feature flags (from snippets.osasnippets.features):
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_ANDROID=true # Android development
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_REACT_NATIVE=true # React Native utilities
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_VSCODE=true # VS Code integration
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_DIRENV=true # Direnv support
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_KEYCHAIN=true # Keychain utilities
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_NGROK=true # Ngrok tunneling
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_MAC_TOOLS=true # macOS utilities
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_XCODE=true # Xcode commands
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_EGPU=true # eGPU management
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_COMPRESSION=true # Compression utilities
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_NODE=true # Node.js (if not using mise)
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_PYTHON=true # Python/pyenv (if not using mise)
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_RUBY=true # Ruby/rbenv (if not using mise)
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_JAVA=true # Java/jenv (if not using mise)
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_NVM=true # NVM for Node.js
# OSA_CONFIG_SNIPPETS_OSASNIPPETS_FNM=true # FNM for Node.js
#
# Runtime versions (from runtimes section):
# OSA_CONFIG_RUNTIMES_NODE_ENABLED=true
# OSA_CONFIG_RUNTIMES_NODE_VERSION=22
# OSA_CONFIG_RUNTIMES_PYTHON_ENABLED=true
# OSA_CONFIG_RUNTIMES_PYTHON_VERSION=3.13
# (and similar for ruby, java, rust, go, deno, elixir, erlang)
#
# These variables are set by the OSA installation wizard and saved to ~/.osa-config
# ==============================================================================