This commit is contained in:
2026-07-29 04:01:25 +09:00
parent 601c94a5d8
commit 3f35a54e0a
18 changed files with 695 additions and 2 deletions
+54
View File
@@ -0,0 +1,54 @@
$ErrorActionPreference = "Stop"
$userDir = Join-Path $env:APPDATA "Code\User"
$runtimeDir = Join-Path $HOME ".vscode"
New-Item -ItemType Directory -Force -Path $userDir, $runtimeDir | Out-Null
Copy-Item (Join-Path $PSScriptRoot "settings.json") `
(Join-Path $userDir "settings.json") -Force
Copy-Item (Join-Path $PSScriptRoot "argv.json") `
(Join-Path $runtimeDir "argv.json") -Force
$codeCandidates = @(
(Join-Path $env:LOCALAPPDATA "Programs\Microsoft VS Code\bin\code.cmd"),
(Join-Path $env:ProgramFiles "Microsoft VS Code\bin\code.cmd")
)
$code = $codeCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
if (-not $code) {
$command = Get-Command code.cmd -ErrorAction SilentlyContinue
if ($command) {
$code = $command.Source
}
}
if (-not $code) {
throw "VS Code CLI was not found."
}
$installedExtensions = @(
& $code --list-extensions |
ForEach-Object { $_.Trim().ToLowerInvariant() }
)
Get-Content (Join-Path $PSScriptRoot "extensions.txt") |
Where-Object { $_.Trim() -and -not $_.Trim().StartsWith("#") } |
ForEach-Object {
$extension = $_.Trim()
if ($installedExtensions -notcontains $extension.ToLowerInvariant()) {
& $code --install-extension $extension
if ($LASTEXITCODE -ne 0) {
throw "Failed to install VS Code extension: $extension"
}
}
}
& $code --update-extensions
if ($LASTEXITCODE -ne 0) {
throw "Failed to update VS Code extensions."
}
+3
View File
@@ -0,0 +1,3 @@
{
"locale": "ja"
}
@@ -0,0 +1,2 @@
# One Visual Studio Code Marketplace extension ID per line.
MS-CEINTL.vscode-language-pack-ja
@@ -0,0 +1,5 @@
{
"workbench.startupEditor": "none",
"editor.formatOnSave": true,
"files.insertFinalNewline": true
}