Skip to content

[dotfiles-improvement] perf: replace $(uname) == "Darwin" with $OSTYPE == darwin* in util.zsh - #542

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-uname-to-ostype-util-49dbc60948444dbf
Draft

[dotfiles-improvement] perf: replace $(uname) == "Darwin" with $OSTYPE == darwin* in util.zsh#542
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-uname-to-ostype-util-49dbc60948444dbf

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Replace $(uname) (subshell fork) with the ZSH built-in $OSTYPE variable in wait-for-url in zsh/util.zsh.

Change

-            if [[ "$(uname)" == "Darwin" ]]; then
+            if [[ "$OSTYPE" == darwin* ]]; then

Why

  • $OSTYPE is a ZSH built-in — no subshell, no process fork
  • darwin* glob is the idiomatic pattern used throughout the rest of this codebase (dns.zsh, wifi.zsh, migrate-laptop.zsh, randomize-mac.zsh, etc.)
  • $(uname) is only called once the URL is reachable, but using $OSTYPE is cleaner and consistent

Files Modified

  • zsh/util.zsh: one-line change in wait-for-url

Generated by Dotfiles Improvement Scanner · ● 18.2M ·

Use the ZSH built-in \$OSTYPE variable instead of spawning a subshell
for \$(uname), matching the idiomatic pattern used throughout the rest
of the codebase.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants