mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 01:18:30 +09:00
windows
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
winget install `
|
||||
--id 9PLM9XGG6VKS `
|
||||
--source msstore `
|
||||
--accept-package-agreements `
|
||||
--accept-source-agreements `
|
||||
--silent `
|
||||
--disable-interactivity
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to install or update ChatGPT."
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$source = Join-Path $PSScriptRoot "gitconfig"
|
||||
$target = Join-Path $HOME ".gitconfig"
|
||||
|
||||
Copy-Item $source $target -Force
|
||||
@@ -0,0 +1,3 @@
|
||||
[user]
|
||||
name = moons-14
|
||||
email = [email protected]
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user