Add pack code for windows terminal

This commit is contained in:
Dax T. Games 2023-09-25 15:59:10 -04:00
parent ab10e83d95
commit ad21915919
4 changed files with 50 additions and 16 deletions

View File

@ -47,10 +47,34 @@ jobs:
working-directory: scripts working-directory: scripts
run: .\build.ps1 -Compile -verbose run: .\build.ps1 -Compile -verbose
- name: Pack the built files - name: Pack the built files with Windows Terminal
shell: pwsh shell: pwsh
working-directory: scripts working-directory: scripts
run: .\pack.ps1 -verbose run: .\pack.ps1 -verbose -emulator windows-terminal
- name: Pack the built files with ConEmu
shell: pwsh
working-directory: scripts
run: .\pack.ps1 -verbose -emulator conemu
- name: Upload artifact (cmder_wt.zip)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt.zip
name: cmder_wt.zip
if-no-files-found: error
- name: Upload artifact (cmder_wt.7z)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt.7z
name: cmder_wt.7z
- name: Upload artifact (cmder_wt_mini.zip)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt_mini.zip
name: cmder_wt_mini.zip
- name: Upload artifact (cmder.zip) - name: Upload artifact (cmder.zip)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -82,8 +106,11 @@ jobs:
with: with:
files: | files: |
build/cmder.zip build/cmder.zip
build/cmder_wt.zip
build/cmder.7z build/cmder.7z
build/cmder_wt.7z
build/cmder_mini.zip build/cmder_mini.zip
build/cmder_wt_mini.zip
build/hashes.txt build/hashes.txt
draft: true draft: true
generate_release_notes: true generate_release_notes: true

View File

@ -23,5 +23,6 @@ appveyor.yml
vendor\cmder.sh vendor\cmder.sh
vendor\git-prompt.sh vendor\git-prompt.sh
config\user-* config\user-*
config\user_*
clink_history* clink_history*
*.log *.log

View File

@ -56,8 +56,8 @@ Param(
# Using this option will skip all downloads, if you only need to build launcher # Using this option will skip all downloads, if you only need to build launcher
[switch]$noVendor, [switch]$noVendor,
# Using this option will specify the emulator to use [conemu-maximus5, or windows-terminal] # Using this option will specify the emulator to use [all, conemu-maximus5, or windows-terminal]
[string]$emulator = 'conemu-maximus5', [string]$emulator = 'all',
# Build launcher if you have MSBuild tools installed # Build launcher if you have MSBuild tools installed
[switch]$Compile [switch]$Compile
@ -153,6 +153,16 @@ if (-not $noVendor) {
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
Extract-Archive $tempArchive $s.name 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) { if ((Get-ChildItem $s.name).Count -eq 1) {
Flatten-Directory($s.name) Flatten-Directory($s.name)
} }
@ -173,12 +183,6 @@ if (-not $noVendor) {
Copy-Item $WinTermSettingsJsonSave $WinTermSettingsJson 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 # 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") ) ) { if ( (Test-Path $($saveTo + "git-for-windows/etc/profile.d") ) ) {
Write-Verbose "Adding cmder.sh /etc/profile.d" Write-Verbose "Adding cmder.sh /etc/profile.d"

View File

@ -46,14 +46,16 @@ Ensure-Executable "7z"
if ($emulator -eq "windows-terminal") { if ($emulator -eq "windows-terminal") {
$targets = @{ $targets = @{
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on"; "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"; "cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`""; "cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
}
} else { } else {
$targets = @{ $targets = @{
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on"; "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"; "cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`""; "cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
}
} }
Push-Location -Path $cmderRoot Push-Location -Path $cmderRoot