File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/zsh
2+ # 这个脚本安装homebrew,powershell这类基础的环境
3+ # 之后可以执行powershell脚本来安装其他软件
4+
5+ command_exists () {
6+ command -v " $* " > /dev/null 2>&1
7+ }
8+ config_zshrc (){
9+ if [ -e ~ /.zshrc ]; then
10+ cp ~ /.zshrc ~ /.zshrc.bak-" $( date +%s) "
11+ rm ~ /.zshrc
12+ fi
13+
14+ script_path=$(
15+ cd $( dirname $0 ) || exit
16+ pwd
17+ )
18+
19+ echo " script_path:$script_path "
20+ # 使用软链接映射zhsrc文件到目标
21+ ln -s " $script_path /config/.zshrc" ~ /.zshrc
22+ }
23+ install_brew (){
24+ if ! command_exists brew; then
25+ echo ' Installing brew...'
26+ /bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
27+ # 配置 .zshrc
28+ config_zshrc
29+ fi
30+ }
31+
32+ install_pwsh (){
33+ if ! command_exists pwsh; then
34+ echo ' Installing pwsh...'
35+ brew install --cask powershell
36+ fi
37+ }
38+
39+ install_uv (){
40+ if ! command_exists uv; then
41+ echo ' Installing uv...'
42+ # On macOS and Linux.
43+ curl -LsSf https://astral.sh/uv/install.sh | sh
44+ fi
45+ }
46+
47+ install (){
48+ install_brew
49+ config_zshrc
50+ install_pwsh
51+ # install_uv
52+ }
53+
54+
55+
56+ install
Original file line number Diff line number Diff line change 1+
2+ $modulePath = Resolve-Path - Path (Join-Path $PSScriptRoot ' ../../psutils' )
3+ Import-Module - Name $modulePath
4+
5+ $configPath = (Resolve-Path - Path (Join-Path $PSScriptRoot ' ../../profile/installer/apps-config.json' )).Path
6+ Install-PackageManagerApps - PackageManager ' homebrew' - ConfigPath $configPath
Original file line number Diff line number Diff line change 1+ # homebrew bin path
2+ export PATH=" /opt/homebrew/bin:$PATH "
3+ # uv 目录
4+ export PATH=" $HOME /.local/bin:$PATH "
5+
6+ # pyenv相关配置
7+ export PYENV_ROOT=" $HOME /.pyenv"
8+ [[ -d $PYENV_ROOT /bin ]] && export PATH=" $PYENV_ROOT /bin:$PATH "
9+ eval " $( pyenv init - zsh) "
10+
11+ command_exists () {
12+ command -v " $* " > /dev/null 2>&1
13+ }
14+
15+ # fnm
16+ if command_exists fnm; then
17+ eval " $( fnm env --use-on-cd --shell zsh) "
18+ fi
19+
20+
21+
You can’t perform that action at this time.
0 commit comments