Skip to content

Commit

Permalink
Merge pull request #876 from mandiant/package-microsoft-windows-terminal
Browse files Browse the repository at this point in the history
🤖 Add microsoft-windows-terminal.vm
  • Loading branch information
Ana06 authored Feb 14, 2024
2 parents 9a25924 + 437cce5 commit 29d62cc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,24 @@ jobs:
- name: Build and test all modified packages
id: test
# It runs only if there are modified files
# We specifically test for "microsoft-windows-terminal.vm" in 'windows-2019' because it requires at least Windows 10 version 1903/OS build 18362
if: steps.files.outputs.added_modified_renamed != ''
run: |
$os = "${{ matrix.os }}"
$packages = "${{ steps.files.outputs.added_modified_renamed }}".Split(" ") | Foreach-Object { (Get-Item $_).Directory.Name }
scripts/test/test_install.ps1 "common.vm $packages"
if ($os -eq 'windows-2019') {
$excludedPackages = @("microsoft-windows-terminal.vm")
$packages = $packages | Where-Object { $_ -notin $excludedPackages }
}
$packages = ("common.vm " + $packages -join " ").Trim()
scripts/test/test_install.ps1 "$packages"
- name: Upload logs to artifacts
uses: ./.github/actions/upload-logs
if: always()
- name: Push all built packages to MyGet
# Only push packages on master if they were built (not if testing was skipped) and
# only with one version of Windows (otherwise it would be pushed 3 times)
if: steps.test.outcome == 'success' && github.event_name == 'push' && matrix.os == 'windows-2019'
if: steps.test.outcome == 'success' && github.event_name == 'push' && matrix.os == 'windows-2022'
run: |
$built_pkgs = Get-ChildItem built_pkgs
Set-Location built_pkgs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>microsoft-windows-terminal.vm</id>
<version>1.18.3181</version>
<authors>Microsoft</authors>
<description>Windows Terminal is a new, modern, feature-rich, productive terminal application for command-line users.</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="microsoft-windows-terminal" version="[1.18.3181]" />
</dependencies>
</metadata>
</package>
15 changes: 15 additions & 0 deletions packages/microsoft-windows-terminal.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'Microsoft Windows Terminal'
$executablePath = '%LocalAppData%\Microsoft\WindowsApps\wt.exe'

$shortcutDir = ${Env:RAW_TOOLS_DIR}
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
# Create an admin shortcut that we can pin to the taskbar (analogous to the Admin Command Prompt for cmd.exe).
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath -RunAsAdmin
VM-Assert-Path $shortcut
} catch {
VM-Write-Log-Exception $_
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'Microsoft Windows Terminal'
$shortcutDir = ${Env:RAW_TOOLS_DIR}
$shortcut = Join-Path $shortcutDir "$toolName.lnk"

Remove-Item $shortcut -Force -ea 0 | Out-Null
1 change: 1 addition & 0 deletions scripts/test/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ class UsesInvalidCategory(Lint):
"installer.vm",
"libraries.python2.vm",
"libraries.python3.vm",
"microsoft-windows-terminal.vm",
"notepadplusplus.vm",
"notepadpp.plugin.",
"npcap.vm",
Expand Down

0 comments on commit 29d62cc

Please sign in to comment.