-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The VS Code shortcut now closes the terminal after Code is launched
- Loading branch information
Showing
5 changed files
with
53 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Set-StrictMode -Version Latest | ||
$ErrorActionPreference = 'Stop' | ||
$ProgressPreference = 'SilentlyContinue' | ||
|
||
. "$PSScriptRoot\pico-env.ps1" | ||
|
||
# On first run, open the pico-examples repo. Open a blank VS Code instance otherwise. | ||
$openArgs = "--disable-workspace-trust `"$PSScriptRoot\pico-examples`"" | ||
$regPath = 'HKCU:\Software\Raspberry Pi\pico-setup-windows' | ||
$regName = 'FirstRun' | ||
$entries = Get-ItemProperty -Path $regPath | ||
if ($entries | Get-Member $regName) { | ||
$openArgs = '' | ||
} else { | ||
Set-ItemProperty -Path $regPath -Name $regName -Value '0' | ||
} | ||
|
||
$codeBinDir = Split-Path -Parent (Get-Command 'code.cmd').Path | ||
$codeExeDir = Split-Path -Parent $codeBinDir | ||
$codeExe = Join-Path $codeExeDir 'code.exe' | ||
|
||
cmd /s /c "start `"`" `"$codeExe`" --new-window $openArgs" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Set-StrictMode -Version Latest | ||
$ErrorActionPreference = 'Stop' | ||
$ProgressPreference = 'SilentlyContinue' | ||
|
||
# https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell | ||
& "${env:COMSPEC}" /s /c "`"$PSScriptRoot\pico-env.cmd`" && set" | ForEach-Object { | ||
$name, $value = $_ -split '=', 2 | ||
Set-Content env:\"$name" $value | ||
} |