2023-12-20 22:48:21 +08:00
<#
. SYNOPSIS
Symlinks . / node_modules / xterm to provided $XtermFolder .
#>
Param (
[ Parameter ( Mandatory = $True ) ]
$XtermFolder
)
2023-12-20 23:06:23 +08:00
$TargetFolder = " ./node_modules/@xterm/xterm "
2023-12-20 22:48:21 +08:00
if ( Test-Path $TargetFolder -PathType Container )
{
2023-12-20 23:06:23 +08:00
Write-Host -ForegroundColor Green " :: Deleting $TargetFolder `n "
2023-12-20 22:48:21 +08:00
Remove-Item -Path $TargetFolder
}
if ( Test-Path $XtermFolder -PathType Container )
{
2023-12-20 23:06:23 +08:00
Write-Host -ForegroundColor Green " `n :: Creating symlink $TargetFolder -> $XtermFolder `n "
2023-12-20 22:48:21 +08:00
New-Item -Path $TargetFolder -ItemType SymbolicLink -Value $XtermFolder
2023-12-20 23:06:23 +08:00
Write-Host -ForegroundColor Green " `n :: Packaging xterm.js `n "
Set-Location $TargetFolder
yarn package - - - -mode development
Set-Location -
Write-Host -ForegroundColor Green " `n :: Finished! To watch changes, open the VS Code terminal in the xterm.js repo and run: `n `n yarn package -- --mode development --watch "
2023-12-20 22:48:21 +08:00
}
else
{
2023-12-20 23:06:23 +08:00
Write-Error -ForegroundColor Red " `n :: $XtermFolder is not a valid folder "
2023-12-20 22:48:21 +08:00
}