mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-15 22:27:51 +08:00
Add pack code for windows terminal
This commit is contained in:
@ -56,8 +56,8 @@ Param(
|
||||
# Using this option will skip all downloads, if you only need to build launcher
|
||||
[switch]$noVendor,
|
||||
|
||||
# Using this option will specify the emulator to use [conemu-maximus5, or windows-terminal]
|
||||
[string]$emulator = 'conemu-maximus5',
|
||||
# Using this option will specify the emulator to use [all, conemu-maximus5, or windows-terminal]
|
||||
[string]$emulator = 'all',
|
||||
|
||||
# Build launcher if you have MSBuild tools installed
|
||||
[switch]$Compile
|
||||
@ -153,6 +153,16 @@ if (-not $noVendor) {
|
||||
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
|
||||
Extract-Archive $tempArchive $s.name
|
||||
|
||||
# Make Embedded Windows Terminal Portable
|
||||
if ($s.name -eq "windows-terminal") {
|
||||
$windowTerminalFiles = resolve-path ($saveTo + "\" + $s.name + "\terminal*")
|
||||
move-item -ErrorAction SilentlyContinue $windowTerminalFiles\* $s.name >$null
|
||||
remove-item -ErrorAction SilentlyContinue $windowTerminalFiles >$null
|
||||
write-verbose "Making Windows Terminal Portable..."
|
||||
New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null
|
||||
New-Item -Type File -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null
|
||||
}
|
||||
|
||||
if ((Get-ChildItem $s.name).Count -eq 1) {
|
||||
Flatten-Directory($s.name)
|
||||
}
|
||||
@ -173,12 +183,6 @@ if (-not $noVendor) {
|
||||
Copy-Item $WinTermSettingsJsonSave $WinTermSettingsJson
|
||||
}
|
||||
|
||||
# Make Embedded Windows Terminal Portable
|
||||
if ($emulator -eq "windows-terminal") {
|
||||
New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null
|
||||
New-Item -Type leaf -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null
|
||||
}
|
||||
|
||||
# Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty
|
||||
if ( (Test-Path $($saveTo + "git-for-windows/etc/profile.d") ) ) {
|
||||
Write-Verbose "Adding cmder.sh /etc/profile.d"
|
||||
|
@ -46,14 +46,16 @@ Ensure-Executable "7z"
|
||||
|
||||
if ($emulator -eq "windows-terminal") {
|
||||
$targets = @{
|
||||
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
||||
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
||||
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`"";
|
||||
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
|
||||
}
|
||||
} else {
|
||||
$targets = @{
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`"";
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
|
||||
}
|
||||
}
|
||||
|
||||
Push-Location -Path $cmderRoot
|
||||
|
Reference in New Issue
Block a user