cmder/scripts/vagrant/add-cmder.ps1

45 lines
1.9 KiB
PowerShell
Raw Normal View History

2023-03-15 19:39:02 +08:00
choco install -y --force 7zip 7zip.install
choco install -y --force cmder
2023-03-24 09:34:30 +08:00
$env:path = "$env:path;c:\tools\cmder\vendor\git-for-windows\cmd;c:\tools\cmder\vendor\git-for-windows\usr\bin;c:\tools\cmder\vendor\git-for-windows\mingw64\bin"
2023-03-15 19:39:02 +08:00
c:
cd $env:userprofile
2023-03-24 10:49:02 +08:00
git clone https://github.com/cmderdev/cmder cmderdev 2>&1
2023-03-15 19:39:02 +08:00
2023-03-24 09:34:30 +08:00
if ("$env:USERNAME" -eq "vagrant" -and -not (test-path "$env:userprofile\cmderdev\vendor\git-for-windows")) {
invoke-expression -command "TAKEOWN /F `"$env:userprofile\cmderdev`" /R /D y /s localhost /u vagrant /p vagrant"
2023-03-15 19:39:02 +08:00
}
2023-03-21 21:20:06 +08:00
cd $env:userprofile/cmderdev
2023-03-15 19:39:02 +08:00
git remote add upstream https://github.com/cmderdev/cmder
2023-03-24 10:49:02 +08:00
Install-PackageProvider -Name NuGet -Force
2023-03-24 09:24:45 +08:00
install-module posh-git -force
2023-03-15 19:39:02 +08:00
2023-03-21 21:20:06 +08:00
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
2023-03-24 10:49:02 +08:00
copy-item -erroraction silentlycontinue "C:\Tools\Cmder\Cmder.exe" "$env:userprofile\cmderdev"
remove-item -erroraction silentlycontinue "$env:userprofile\cmderdev\launcher\x64\release\cmder.exe" -force
2023-03-24 08:18:01 +08:00
2023-03-24 10:49:02 +08:00
start-process -erroraction silentlycontinue -nonewwindow -workingdirectory "$env:userprofile\cmderdev\scripts" -filepath "powershell.exe" -argumentlist ".\build.ps1 -verbose -compile"
2023-03-24 08:18:01 +08:00
2023-03-24 10:49:02 +08:00
copy-item -erroraction silentlycontinue "$env:userprofile\cmderdev\launcher\x64\release\cmder.exe" "$env:userprofile\cmderdev" -force
2023-03-15 19:39:02 +08:00
# tabby
2023-03-17 05:32:46 +08:00
setx cmder_root "${env:userprofile}\cmderdev"
2023-03-15 19:39:02 +08:00
# C:\Users\vagrant\AppData\Roaming\Hyper
# // shell: '',
# shell: 'cmd.exe',
# // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
# // by default `['--login']` will be used
# // shellArgs: ['--login'],
# shellArgs: ['/k', 'C:\\users\\vagrant\\cmderdev\\vendor\\init.bat'],