machineconfig 6.86__py3-none-any.whl → 6.88__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of machineconfig might be problematic. Click here for more details.

Files changed (31) hide show
  1. machineconfig/jobs/installer/installer_data.json +18 -1
  2. machineconfig/scripts/linux/mcfgs +44 -35
  3. machineconfig/scripts/python/agents.py +2 -15
  4. machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
  5. machineconfig/scripts/python/fire_jobs.py +7 -11
  6. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +6 -7
  7. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_cursor_agents.py +3 -4
  8. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +9 -10
  9. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +4 -5
  10. machineconfig/scripts/python/helpers_agents/fire_agents_help_launch.py +9 -6
  11. machineconfig/scripts/python/helpers_agents/fire_agents_helper_types.py +4 -14
  12. machineconfig/scripts/python/helpers_devops/cli_config.py +1 -1
  13. machineconfig/scripts/python/helpers_devops/cli_self.py +19 -12
  14. machineconfig/scripts/python/helpers_fire_command/file_wrangler.py +40 -1
  15. machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +1 -1
  16. machineconfig/scripts/python/nw/mount_nfs +1 -1
  17. machineconfig/scripts/windows/mcfgs.ps1 +50 -13
  18. machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
  19. machineconfig/settings/lf/windows/lfrc +14 -16
  20. machineconfig/settings/shells/bash/init.sh +11 -10
  21. machineconfig/settings/shells/pwsh/init.ps1 +38 -16
  22. machineconfig/setup_linux/web_shortcuts/interactive.sh +1 -1
  23. machineconfig/setup_mac/apps_gui.sh +248 -0
  24. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +1 -1
  25. machineconfig/utils/code.py +18 -10
  26. machineconfig/utils/ssh.py +1 -1
  27. {machineconfig-6.86.dist-info → machineconfig-6.88.dist-info}/METADATA +1 -1
  28. {machineconfig-6.86.dist-info → machineconfig-6.88.dist-info}/RECORD +31 -30
  29. {machineconfig-6.86.dist-info → machineconfig-6.88.dist-info}/WHEEL +0 -0
  30. {machineconfig-6.86.dist-info → machineconfig-6.88.dist-info}/entry_points.txt +0 -0
  31. {machineconfig-6.86.dist-info → machineconfig-6.88.dist-info}/top_level.txt +0 -0
@@ -1,17 +1,54 @@
1
- # Generate a random name (based on current timestamp hashed with SHA256)
2
- $timestamp = Get-Date -Format o | Get-FileHash -Algorithm SHA256
3
- $randomName = ($timestamp.Hash.Substring(0, 16))
1
+ function warp_in_op_code {
2
+ param(
3
+ [Parameter(Mandatory=$true)]
4
+ [string]$Command,
5
+
6
+ [Parameter(ValueFromRemainingArguments=$true)]
7
+ [string[]]$Arguments
8
+ )
9
+
10
+ # Generate a random name (based on current timestamp hashed with SHA256)
11
+ # Compute SHA256 of the timestamp string (don't pipe the string to Get-FileHash
12
+ # because that attempts to treat the input as a path). Take the first 16 hex
13
+ # chars as the random name.
14
+ $ts = Get-Date -Format o
15
+ try {
16
+ $sha = [System.Security.Cryptography.SHA256]::Create()
17
+ $bytes = [System.Text.Encoding]::UTF8.GetBytes($ts)
18
+ $hashBytes = $sha.ComputeHash($bytes)
19
+ $hash = [System.BitConverter]::ToString($hashBytes).Replace("-", "").ToLower()
20
+ $randomName = $hash.Substring(0, 16)
21
+ } finally {
22
+ if ($sha) { $sha.Dispose() }
23
+ }
4
24
 
5
- # Define the output path
6
- $env:OP_PROGRAM_PATH = "$HOME/tmp_results/tmp_scripts/machineconfig/${randomName}.ps1"
25
+ # Define the output path
26
+ $env:OP_PROGRAM_PATH = "$HOME/tmp_results/tmp_scripts/machineconfig/${randomName}.ps1"
7
27
 
8
- # Run your equivalent command (replace with your actual command)
9
- mcfg @args
28
+ # Run the specified command with its arguments
29
+ & $Command @Arguments
10
30
 
11
- # Check if the file exists
12
- if (Test-Path $env:OP_PROGRAM_PATH) {
13
- Write-Host "Found op program at: $env:OP_PROGRAM_PATH"
14
- & $env:OP_PROGRAM_PATH
15
- } else {
16
- Write-Host "no op program found"
31
+ # Check if the file exists
32
+ if (Test-Path $env:OP_PROGRAM_PATH) {
33
+ Write-Host "Found op program at: $env:OP_PROGRAM_PATH"
34
+ & $env:OP_PROGRAM_PATH
35
+ } else {
36
+ Write-Host "no op program found"
37
+ }
38
+
39
+ # Clean up the temporary environment variable so it doesn't leak to other processes/sessions
40
+ try {
41
+ Remove-Item Env:\OP_PROGRAM_PATH -ErrorAction SilentlyContinue
42
+ } catch {
43
+ # best-effort cleanup; ignore any errors
44
+ }
45
+
46
+ # Also explicitly clear the variable in the current process
47
+ $env:OP_PROGRAM_PATH = $null
17
48
  }
49
+
50
+ # Call the function with any arguments passed to the script
51
+ if ($args.Count -gt 0) {
52
+ warp_in_op_code @args
53
+ }
54
+
@@ -7,7 +7,7 @@ $user = ''
7
7
  $sharePath = ''
8
8
  $driveLetter = ''
9
9
 
10
- uv run --python 3.14 --with "machineconfig>=6.86" python -m machineconfig.scripts.python.mount_ssh
10
+ uv run --python 3.14 --with "machineconfig>=6.88" python -m machineconfig.scripts.python.mount_ssh
11
11
 
12
12
  net use T: \\sshfs.kr\$user@$host.local
13
13
  # this worked: net use T: \\sshfs\alex@alex-p51s-5.local
@@ -51,19 +51,19 @@ map x
51
51
  map c
52
52
  map v
53
53
  map r
54
- map D $diskonaut $env:f
55
- map K $kondo $env:f
54
+ map D $diskonaut $f
55
+ map K $kondo $f
56
56
  map r reload
57
57
 
58
58
 
59
59
  # e edit
60
60
  map e # edit modal key.
61
- map en $nano $env:f
62
- map el $pwsh -File $env:USERPROFILE/.local/bin/lvim.ps1 -- $env:f
63
- map ev $nvim $env:f
64
- map ec $code $env:f
61
+ map en $nano $f
62
+ map el $pwsh -File $env:USERPROFILE/.local/bin/lvim.ps1 -- $f
63
+ map ev $nvim $f
64
+ map ec $code $f
65
65
  map ep $& 'C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2022.2\bin\pycharm.exe' $f
66
- map o $start $env:f
66
+ map o $start $f
67
67
  map <enter> open
68
68
 
69
69
 
@@ -73,27 +73,25 @@ map ww $powershell
73
73
  map wp $pwsh
74
74
  map wc $croshell.ps1
75
75
  map wm $cmd
76
- map i $~/.config/machineconfig/settings/lf/windows/previewer.ps1 $env:f
77
- map R $powershell $env:USERPROFILE/scripts/croshell.ps1 -r $env:f
76
+ map i $~/.config/machineconfig/settings/lf/windows/previewer.ps1 $f
77
+ map R $powershell $env:USERPROFILE/scripts/croshell.ps1 -r $f
78
78
 
79
79
  # o file/folder Operations
80
80
  map o
81
81
  map od cut
82
82
  map op paste
83
83
  map oy copy
84
- map oc $Set-Clipboard -Value $env:f
84
+ map oc $Set-Clipboard -Value $f
85
85
  map c clear
86
86
  map or rename
87
- map <delete> :{{
88
- delete
89
- echo 'FINISHED DELETEING'
90
- }}
87
+ map <delete> delete
88
+ map <del> delete
91
89
  map of reload
92
90
  map os mark-save
93
91
  map ol mark-load
94
92
  map oR mark-remove
95
- map oD !ouch d $env:f
96
- map oC !ouch c $env:f '$env:f'.zip
93
+ map oD !ouch d $f
94
+ map oC !ouch c $f '$f'.zip
97
95
 
98
96
  # j jump
99
97
  map j
@@ -37,23 +37,24 @@ add_to_path_if_not_already \
37
37
  . $CONFIG_ROOT/settings/broot/br.sh
38
38
  . $CONFIG_ROOT/settings/lf/linux/exe/lfcd.sh
39
39
  . $CONFIG_ROOT/settings/tere/terecd.sh
40
+ . $CONFIG_ROOT/scripts/linux/mcfgs
41
+
40
42
  # check if file in ~/dotfiles/machineconfig/init_linux.sh exists and source it
41
43
  if [ -f "$HOME/dotfiles/machineconfig/init_linux.sh" ]; then
42
44
  # echo "Sourcing $HOME/dotfiles/machineconfig/init_linux.sh"
43
45
  source "$HOME/dotfiles/machineconfig/init_linux.sh"
44
46
  fi
45
47
 
46
- # set alias l to lsd -la
47
48
  alias l='lsd -la'
48
- alias d=devops
49
- alias c=cloud
50
- alias a=agents
51
- alias s=sessions
52
- alias ff=ftpx
53
- alias f=fire
54
- alias r=croshell
55
- alias u=utils
56
- alias t=term
49
+ alias d='wrap_in_op_program devops'
50
+ alias c='wrap_in_op_program cloud'
51
+ alias a='wrap_in_op_program agents'
52
+ alias s='wrap_in_op_program sessions'
53
+ alias ff='wrap_in_op_program ftpx'
54
+ alias f='wrap_in_op_program fire'
55
+ alias r='wrap_in_op_program croshell'
56
+ alias u='wrap_in_op_program utils'
57
+ alias t='wrap_in_op_program term'
57
58
 
58
59
 
59
60
  # alias gcs='gh copilot suggest -t shell'
@@ -24,22 +24,44 @@ Add-ToPathIfNotAlready -Directories @(
24
24
  )
25
25
 
26
26
  # sources ================================================================
27
- . $CONFIG_ROOT\settings\broot\brootcd.ps1
28
- . $CONFIG_ROOT\settings\lf\windows\lfcd.ps1
29
- . $CONFIG_ROOT\settings\tere\terecd.ps1
30
-
31
-
32
- function lsdla { lsd -la }
33
- Set-Alias -Name l -Value lsdla -Option AllScope
34
- function d { devops @args }
35
- function c { cloud @args }
36
- function a { agents @args }
37
- function ss { sessions @args }
38
- function ff { ftpx @args }
39
- function f { fire @args }
40
- function rr { croshell @args }
41
- function u { utils @args }
42
- function t { terminal @args }
27
+ if (Test-Path "$CONFIG_ROOT\scripts\windows\mcfgs.ps1") {
28
+ . $CONFIG_ROOT\settings\broot\brootcd.ps1
29
+ . $CONFIG_ROOT\settings\lf\windows\lfcd.ps1
30
+ . $CONFIG_ROOT\settings\tere\terecd.ps1
31
+ . $CONFIG_ROOT\scripts\windows\mcfgs.ps1
32
+
33
+ function lsdla { lsd -la }
34
+ Set-Alias -Name l -Value lsdla -Option AllScope
35
+ function d { warp_in_op_code devops @args }
36
+ function c { warp_in_op_code cloud @args }
37
+ function a { warp_in_op_code agents @args }
38
+ function ss { warp_in_op_code sessions @args }
39
+ function ff { warp_in_op_code ftpx @args }
40
+ function f { warp_in_op_code fire @args }
41
+ function rr { warp_in_op_code croshell @args }
42
+ function u { warp_in_op_code utils @args }
43
+ function t { warp_in_op_code terminal @args }
44
+
45
+ }
46
+ else {
47
+ Write-Host "Missing config files: $CONFIG_ROOT"
48
+ function lsdla { lsd -la }
49
+ Set-Alias -Name l -Value lsdla -Option AllScope
50
+ function d { devops @args }
51
+ function c { cloud @args }
52
+ function a { agents @args }
53
+ function ss { sessions @args }
54
+ function ff { ftpx @args }
55
+ function f { fire @args }
56
+ function rr { croshell @args }
57
+ function u { utils @args }
58
+ function t { terminal @args }
59
+
60
+ }
61
+
62
+
63
+
64
+ # sources end
43
65
 
44
66
  # try {
45
67
  # Set-Alias -Name gcs -Value {gh copilot suggest -t shell}
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
  . <( curl -sSL "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/uv.sh")
3
3
  mcfg() {
4
- "$HOME/.local/bin/uv" run --python 3.14 --with "machineconfig>=6.86" mcfg "$@"
4
+ "$HOME/.local/bin/uv" run --python 3.14 --with "machineconfig>=6.88" mcfg "$@"
5
5
  }
6
6
  alias d="mcfg devops"
7
7
  alias c="mcfg cloud"
@@ -0,0 +1,248 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # macOS GUI Application Installation Script
4
+ # Comprehensive GUI application installation via Homebrew Cask and Mac App Store
5
+ # Supports Intel and Apple Silicon architectures
6
+
7
+ set -e # Exit on any error
8
+
9
+ # Color codes for output
10
+ RED='\033[0;31m'
11
+ GREEN='\033[0;32m'
12
+ YELLOW='\033[1;33m'
13
+ BLUE='\033[0;34m'
14
+ NC='\033[0m' # No Color
15
+
16
+ # Logging functions
17
+ log_info() {
18
+ echo -e "${BLUE}ℹ️ $1${NC}"
19
+ }
20
+
21
+ log_success() {
22
+ echo -e "${GREEN}✅ $1${NC}"
23
+ }
24
+
25
+ log_warning() {
26
+ echo -e "${YELLOW}⚠️ $1${NC}"
27
+ }
28
+
29
+ log_error() {
30
+ echo -e "${RED}❌ $1${NC}"
31
+ }
32
+
33
+ # Architecture detection
34
+ detect_architecture() {
35
+ local arch=$(uname -m)
36
+ if [[ "$arch" == "arm64" ]]; then
37
+ echo "arm64"
38
+ elif [[ "$arch" == "x86_64" ]]; then
39
+ echo "amd64"
40
+ else
41
+ log_warning "Unknown architecture: $arch, defaulting to amd64"
42
+ echo "amd64"
43
+ fi
44
+ }
45
+
46
+ # Check if Homebrew is installed
47
+ check_homebrew() {
48
+ if ! command -v brew &> /dev/null; then
49
+ log_error "Homebrew is not installed. Please run apps.sh first to install Homebrew."
50
+ exit 1
51
+ fi
52
+ log_success "Homebrew found"
53
+ }
54
+
55
+ # Setup Mac App Store CLI
56
+ setup_mas() {
57
+ log_info "Setting up Mac App Store CLI (mas)..."
58
+
59
+ if ! command -v mas &> /dev/null; then
60
+ log_info "Installing mas (Mac App Store CLI)..."
61
+ brew install mas || {
62
+ log_error "Failed to install mas"
63
+ return 1
64
+ }
65
+ else
66
+ log_success "mas already installed"
67
+ fi
68
+
69
+ # Check if user is signed in to Mac App Store
70
+ if ! mas account &> /dev/null; then
71
+ log_warning "Not signed in to Mac App Store. Some applications may not install."
72
+ log_info "Please sign in to the Mac App Store manually to install App Store applications."
73
+ else
74
+ log_success "Signed in to Mac App Store"
75
+ fi
76
+ }
77
+
78
+ # Install a GUI application with error handling
79
+ install_gui_app() {
80
+ local app_name="$1"
81
+ local description="$2"
82
+ local install_cmd="$3"
83
+ local fallback_cmd="$4"
84
+
85
+ log_info "Installing $description..."
86
+
87
+ if eval "$install_cmd"; then
88
+ log_success "$app_name installed successfully"
89
+ return 0
90
+ elif [[ -n "$fallback_cmd" ]]; then
91
+ log_warning "Primary installation failed, trying fallback method..."
92
+ if eval "$fallback_cmd"; then
93
+ log_success "$app_name installed via fallback method"
94
+ return 0
95
+ else
96
+ log_error "Failed to install $app_name via fallback method"
97
+ return 1
98
+ fi
99
+ else
100
+ log_error "Failed to install $app_name"
101
+ return 1
102
+ fi
103
+ }
104
+
105
+ # Install GUI applications from a list
106
+ install_gui_app_list() {
107
+ local group_name="$1"
108
+ shift
109
+ local apps=("$@")
110
+
111
+ log_info "Installing $group_name applications..."
112
+
113
+ local failed_apps=()
114
+ for app_info in "${apps[@]}"; do
115
+ IFS='|' read -r app_name description install_cmd fallback_cmd <<< "$app_info"
116
+ if ! install_gui_app "$app_name" "$description" "$install_cmd" "$fallback_cmd"; then
117
+ failed_apps+=("$app_name")
118
+ fi
119
+ done
120
+
121
+ if [[ ${#failed_apps[@]} -gt 0 ]]; then
122
+ log_warning "$group_name: Failed to install: ${failed_apps[*]}"
123
+ else
124
+ log_success "All $group_name applications installed successfully"
125
+ fi
126
+ }
127
+
128
+ # Main installation function
129
+ main() {
130
+ log_info "Starting macOS GUI application installation..."
131
+ log_info "Detected architecture: $(detect_architecture)"
132
+
133
+ # Check prerequisites
134
+ check_homebrew
135
+ setup_mas
136
+
137
+ # --GROUP:BROWSERS - Web browsers
138
+ local browsers=(
139
+ "brave-browser|Brave Browser - Privacy-focused web browser|brew install --cask brave-browser|"
140
+ "google-chrome|Google Chrome web browser|brew install --cask google-chrome|"
141
+ "firefox|Mozilla Firefox web browser|brew install --cask firefox|"
142
+ "microsoft-edge|Microsoft Edge web browser|brew install --cask microsoft-edge|"
143
+ "safari-technology-preview|Safari Technology Preview|brew install --cask safari-technology-preview|"
144
+ )
145
+
146
+ install_gui_app_list "Browsers" "${browsers[@]}"
147
+
148
+ # --GROUP:CODE_EDITORS - Code editors and IDEs
149
+ local code_editors=(
150
+ "visual-studio-code|Visual Studio Code|brew install --cask visual-studio-code|"
151
+ "cursor|Cursor AI-powered code editor|brew install --cask cursor|"
152
+ "sublime-text|Sublime Text editor|brew install --cask sublime-text|"
153
+ "atom|Atom text editor|brew install --cask atom|"
154
+ "webstorm|JetBrains WebStorm IDE|brew install --cask webstorm|"
155
+ "pycharm|JetBrains PyCharm IDE|brew install --cask pycharm|"
156
+ "intellij-idea|JetBrains IntelliJ IDEA|brew install --cask intellij-idea|"
157
+ "xcode|Xcode development environment|mas install 497799835|brew install --cask xcode"
158
+ )
159
+
160
+ install_gui_app_list "Code Editors & IDEs" "${code_editors[@]}"
161
+
162
+ # --GROUP:PRODUCTIVITY - Productivity and office applications
163
+ local productivity=(
164
+ "obsidian|Obsidian note-taking app|brew install --cask obsidian|"
165
+ "notion|Notion workspace|brew install --cask notion|"
166
+ "bitwarden|Bitwarden password manager|brew install --cask bitwarden|"
167
+ "1password|1Password password manager|brew install --cask 1password|mas install 1333542190"
168
+ "alfred|Alfred productivity app|brew install --cask alfred|"
169
+ "raycast|Raycast launcher and productivity tool|brew install --cask raycast|"
170
+ "rectangle|Rectangle window management|brew install --cask rectangle|"
171
+ "magnet|Magnet window manager|mas install 441258766|brew install --cask magnet"
172
+ "cleanmymac|CleanMyMac X system cleaner|mas install 1339170533|"
173
+ )
174
+
175
+ install_gui_app_list "Productivity" "${productivity[@]}"
176
+
177
+ # --GROUP:MEDIA - Media and entertainment applications
178
+ local media=(
179
+ "vlc|VLC media player|brew install --cask vlc|"
180
+ "obs|OBS Studio for streaming and recording|brew install --cask obs|"
181
+ "handbrake|HandBrake video transcoder|brew install --cask handbrake|"
182
+ "spotify|Spotify music streaming|brew install --cask spotify|mas install 324684580"
183
+ "youtube-music|YouTube Music|brew install --cask youtube-music|"
184
+ "plex|Plex media server|brew install --cask plex|"
185
+ "keka|Keka archive utility|brew install --cask keka|mas install 470158793"
186
+ "the-unarchiver|The Unarchiver|brew install --cask the-unarchiver|mas install 425424353"
187
+ )
188
+
189
+ install_gui_app_list "Media & Entertainment" "${media[@]}"
190
+
191
+ # --GROUP:DEVELOPMENT - Development and system tools
192
+ local development=(
193
+ "docker|Docker Desktop|brew install --cask docker|"
194
+ "postman|Postman API development|brew install --cask postman|"
195
+ "insomnia|Insomnia REST client|brew install --cask insomnia|"
196
+ "github-desktop|GitHub Desktop|brew install --cask github-desktop|"
197
+ "sourcetree|Sourcetree Git client|brew install --cask sourcetree|"
198
+ "iterm2|iTerm2 terminal emulator|brew install --cask iterm2|"
199
+ "warp|Warp modern terminal|brew install --cask warp|"
200
+ "alacritty|Alacritty terminal emulator|brew install --cask alacritty|"
201
+ )
202
+
203
+ install_gui_app_list "Development Tools" "${development[@]}"
204
+
205
+ # --GROUP:DATABASE - Database management tools
206
+ local database=(
207
+ "dbeaver-community|DBeaver database tool|brew install --cask dbeaver-community|"
208
+ "sequel-pro|Sequel Pro MySQL client|brew install --cask sequel-pro|"
209
+ "tableplus|TablePlus database client|brew install --cask tableplus|"
210
+ "redis-insight|RedisInsight Redis GUI|brew install --cask redisinsight|"
211
+ "mongodb-compass|MongoDB Compass|brew install --cask mongodb-compass|"
212
+ )
213
+
214
+ install_gui_app_list "Database Tools" "${database[@]}"
215
+
216
+ # --GROUP:COMMUNICATION - Communication and collaboration
217
+ local communication=(
218
+ "slack|Slack team communication|brew install --cask slack|mas install 803453959"
219
+ "discord|Discord voice and text chat|brew install --cask discord|"
220
+ "zoom|Zoom video conferencing|brew install --cask zoom|"
221
+ "microsoft-teams|Microsoft Teams|brew install --cask microsoft-teams|"
222
+ "whatsapp|WhatsApp Desktop|brew install --cask whatsapp|mas install 1147396723"
223
+ "telegram|Telegram messaging|brew install --cask telegram|mas install 747648890"
224
+ )
225
+
226
+ install_gui_app_list "Communication" "${communication[@]}"
227
+
228
+ # --GROUP:SYSTEM_UTILITIES - System utilities and maintenance
229
+ local system_utilities=(
230
+ "appcleaner|AppCleaner uninstaller|brew install --cask appcleaner|"
231
+ "coconutbattery|CoconutBattery system info|brew install --cask coconutbattery|"
232
+ "disk-utility|Disk Utility (built-in)|echo 'Disk Utility is built into macOS'|"
233
+ "activity-monitor|Activity Monitor (built-in)|echo 'Activity Monitor is built into macOS'|"
234
+ "finder|Finder (built-in)|echo 'Finder is built into macOS'|"
235
+ "homebrew|Homebrew package manager|echo 'Homebrew already installed'|"
236
+ )
237
+
238
+ install_gui_app_list "System Utilities" "${system_utilities[@]}"
239
+
240
+ log_success "macOS GUI application installation completed!"
241
+ log_info "Some applications may require additional setup or signing in to your accounts."
242
+ log_info "Check Applications folder for newly installed apps."
243
+ }
244
+
245
+ # Execute main function if script is run directly
246
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
247
+ main "$@"
248
+ fi
@@ -2,7 +2,7 @@
2
2
 
3
3
  iex (iwr "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/uv.ps1").Content
4
4
  function mcfg {
5
- & "$HOME\.local\bin\uv.exe" run --python 3.14 --with "machineconfig>=6.86" mcfg $args
5
+ & "$HOME\.local\bin\uv.exe" run --python 3.14 --with "machineconfig>=6.88" mcfg $args
6
6
  }
7
7
  function d { mcfg devops @args }
8
8
  function c { mcfg cloud @args }
@@ -82,29 +82,29 @@ def run_shell_script(script: str, display_script: bool = True, clean_env: bool =
82
82
  lexer = "bash"
83
83
  with tempfile.NamedTemporaryFile(mode='w', suffix=suffix, delete=False, encoding='utf-8') as temp_file:
84
84
  temp_file.write(script)
85
- temp_script_path = Path(temp_file.name)
85
+ temp_shell_script_path = Path(temp_file.name)
86
86
  console = Console()
87
87
  if display_script:
88
88
  from rich.syntax import Syntax
89
- console.print(Panel(Syntax(code=script, lexer=lexer), title=f"📄 shell script @ {temp_script_path}", subtitle="shell script being executed"), style="bold red")
89
+ console.print(Panel(Syntax(code=script, lexer=lexer), title=f"📄 shell script @ {temp_shell_script_path}", subtitle="shell script being executed"), style="bold red")
90
90
  env = {} if clean_env else None
91
91
  if platform.system() == "Windows":
92
92
  import subprocess
93
- proc = subprocess.run(f'powershell -ExecutionPolicy Bypass -File "{temp_script_path}"', check=True, shell=True, env=env)
93
+ proc = subprocess.run(f'powershell -ExecutionPolicy Bypass -File "{temp_shell_script_path}"', check=True, shell=True, env=env)
94
94
  elif platform.system() == "Linux" or platform.system() == "Darwin":
95
95
  import subprocess
96
- proc = subprocess.run(f"bash {str(temp_script_path)}", check=True, shell=True, env=env)
96
+ proc = subprocess.run(f"bash {str(temp_shell_script_path)}", check=True, shell=True, env=env)
97
97
  else:
98
98
  raise NotImplementedError(f"Platform {platform.system()} not supported.")
99
99
  # console.print(f"✅ [green]Script executed successfully:[/green] [blue]{temp_script_path}[/blue]")
100
100
  if proc.returncode != 0:
101
- console.print(f"❌ [red]Script execution failed with return code {proc.returncode}:[/red] [blue]{temp_script_path}[/blue]")
101
+ console.print(f"❌ [red]Script execution failed with return code {proc.returncode}:[/red] [blue]{temp_shell_script_path}[/blue]")
102
102
  elif proc.returncode == 0:
103
- console.print(f"✅ [green]Script executed successfully:[/green] [blue]{temp_script_path}[/blue]")
103
+ console.print(f"✅ [green]Script executed successfully:[/green] [blue]{temp_shell_script_path}[/blue]")
104
104
  else:
105
- console.print(f"⚠️ [yellow]Script executed with warnings (return code {proc.returncode}):[/yellow] [blue]{temp_script_path}[/blue]")
106
- temp_script_path.unlink(missing_ok=True)
107
- console.print(f"🗑️ [blue]Temporary script deleted:[/blue] [green]{temp_script_path}[/green]")
105
+ console.print(f"⚠️ [yellow]Script executed with warnings (return code {proc.returncode}):[/yellow] [blue]{temp_shell_script_path}[/blue]")
106
+ temp_shell_script_path.unlink(missing_ok=True)
107
+ console.print(f"🗑️ [blue]Temporary script deleted:[/blue] [green]{temp_shell_script_path}[/green]")
108
108
  return proc
109
109
 
110
110
 
@@ -112,10 +112,18 @@ def exit_then_run_shell_script(script: str, strict: bool = False):
112
112
  import os
113
113
  op_program_path = os.environ.get("OP_PROGRAM_PATH", None)
114
114
  if strict and op_program_path is None:
115
- raise ValueError("OP_PROGRAM_PATH environment variable is not set in strict mode.")
115
+ op_program_path = Path.home().joinpath("tmp_results", "tmp_scripts", "manual_run", f"manual_script_{randstr()}.ps1")
116
+ op_program_path.parent.mkdir(parents=True, exist_ok=True)
117
+ op_program_path.write_text(script, encoding="utf-8")
118
+ print_code(script, lexer="powershell", desc="script to run manually")
119
+ print(f"Please run the script manually via your PowerShell by executing the script @:\n{str(op_program_path)}")
120
+ print("OP_PROGRAM_PATH environment variable is not set in strict mode.")
116
121
  if op_program_path is not None:
117
122
  op_program_path = Path(op_program_path)
118
123
  op_program_path.parent.mkdir(parents=True, exist_ok=True)
119
124
  op_program_path.write_text(script, encoding="utf-8")
125
+ print(f"Handing over to powershell script runner via OP_PROGRAM_PATH @\n{str(op_program_path)}...")
120
126
  else:
121
127
  run_shell_script(script)
128
+ import sys
129
+ sys.exit(0)
@@ -8,7 +8,7 @@ from machineconfig.utils.terminal import Response
8
8
  from machineconfig.utils.accessories import pprint, randstr
9
9
  from machineconfig.utils.meta import lambda_to_python_script
10
10
  UV_RUN_CMD = "$HOME/.local/bin/uv run" if platform.system() != "Windows" else """& "$env:USERPROFILE/.local/bin/uv" run"""
11
- MACHINECONFIG_VERSION = "machineconfig>=6.86"
11
+ MACHINECONFIG_VERSION = "machineconfig>=6.88"
12
12
  DEFAULT_PICKLE_SUBDIR = "tmp_results/tmp_scripts/ssh"
13
13
 
14
14
  class SSH:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: machineconfig
3
- Version: 6.86
3
+ Version: 6.88
4
4
  Summary: Dotfiles management package
5
5
  Author-email: Alex Al-Saffar <programmer@usa.com>
6
6
  License: Apache 2.0