Skip to content

Instantly share code, notes, and snippets.

@solrevdev
Created December 17, 2023 12:01
Show Gist options
  • Save solrevdev/d1c36ee8ced7794cd7df594f2d32cecd to your computer and use it in GitHub Desktop.
Save solrevdev/d1c36ee8ced7794cd7df594f2d32cecd to your computer and use it in GitHub Desktop.
/Users/solrevdev/.config/powershell/Microsoft.VSCode_profile.ps1
# https://chat.openai.com/c/1422db25-ebe5-4964-be64-0ea089c2842c
# Determine the architecture of the macOS machine
if ($env:OS -eq "Windows_NT") {
# Windows Subsystem for Linux interoperability, if needed
# Set environment variables for WSL
} else {
# Default to Intel paths
$brewPrefix = "/usr/local"
$brewCellar = "/usr/local/Cellar"
$brewRepository = "/usr/local/Homebrew"
# Check for Apple Silicon and adjust if necessary
if ($env:PATH -like "*/opt/homebrew/bin*") {
$brewPrefix = "/opt/homebrew"
$brewCellar = "/opt/homebrew/Cellar"
$brewRepository = "/opt/homebrew/Homebrew"
}
# Set the Homebrew environment variables based on the architecture
$env:HOMEBREW_PREFIX = $brewPrefix
$env:HOMEBREW_CELLAR = $brewCellar
$env:HOMEBREW_REPOSITORY = $brewRepository
$env:PATH = "$brewPrefix/bin:$brewPrefix/sbin" + ${env:PATH+":$env:PATH"}
$env:MANPATH = "$brewPrefix/share/man" + ${env:MANPATH+":$env:MANPATH"} + ":"
$env:INFOPATH = "$brewPrefix/share/info" + ${env:INFOPATH:-":"}
}
# Ensure any other personal PowerShell profile settings are below this line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment