-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_and_install.ps1
More file actions
23 lines (23 loc) · 900 Bytes
/
Copy pathbuild_and_install.ps1
File metadata and controls
23 lines (23 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function ReinstallExtension(){
Write-Host "Building package with vsce ..."
vsce package -o build.vsix
code --uninstall-extension aniel.anlici
code --install-extension build.vsix
Remove-Item build.vsix
}
$locaction = Get-Location
$path = Join-Path $locaction 'themes'
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = $path
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
Write-Host "Start watching for file changes..."
while($TRUE){
$result = $watcher.WaitForChanged([System.IO.WatcherChangeTypes]::Changed -bor [System.IO.WatcherChangeTypes]::Renamed -bOr [System.IO.WatcherChangeTypes]::Created, 1000);
if($result.TimedOut){
continue;
}
write-host "File " $result.Name " Changed. Installing extension.."
ReinstallExtension
}