dotfiles/bin/install.ps1

60 lines
2 KiB
PowerShell
Raw Normal View History

#!/usr/bin/pwsh
2022-09-20 15:47:11 +09:00
# dotfiles install script for Windows
# Execute
# Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# first to run pwsh scripts
# check administration role
#Requires -RunAsAdministrator
# check pwsh version
# ≧ 7
#Requires -Version 7
2022-09-20 01:51:16 +09:00
# check working directory
if (!(
(Test-Path bin) -and (Test-Path dotfiles)
)) {
Write-Warning -Message "wrong current path
please execute at repo root"
exit 1
}
2022-09-22 22:14:49 +09:00
# install powershell modules
2022-09-29 04:11:43 +09:00
Write-Output "posh git"
2022-09-22 22:14:49 +09:00
Install-Module -Name posh-git
2022-09-29 04:11:43 +09:00
Write-Output "Pscx"
2022-09-22 22:14:49 +09:00
Install-Module -Name Pscx -AllowPrerelease
2022-09-29 04:11:43 +09:00
Write-Output "z"
Install-Module -Name ZLocation
Write-Output "PSFzf"
Install-Module -Name PSFzf -RequiredVersion 2.5.10
Write-Output "Latest PSReadLine"
Install-Module -Name PSReadLine -Force # Override default version to get the latest one
Write-Output "CompletionPredictor"
Install-Module -Name CompletionPredictor
# install scoop
if(!(Get-Command scoop -ErrorAction SilentlyContinue)) {
Write-Output "Installing scoop..."
irm get.scoop.sh | iex
}
# install basic scoop apps
# import from exported json file
2022-10-21 16:55:07 +09:00
# to update the json file, execute ./bin/windows/scoop_apps/update_scoop_list.ps1
scoop import .\bin\windows\scoop_apps\scoop_minimal_apps.json
2022-09-22 22:14:49 +09:00
2022-09-20 01:51:16 +09:00
# make symbolic links
# neovim
2022-10-17 16:56:28 +09:00
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\init.lua -Target (Resolve-Path .\dotfiles\neovim\init.lua) -Force
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\plugins.lua -Target (Resolve-Path .\dotfiles\neovim\lua\plugins.lua) -Force
New-Item -ItemType SymbolicLink -Path ~\AppData\Local\nvim\lua\lualine_setup.lua -Target (Resolve-Path .\dotfiles\neovim\lua\lualine_setup.lua) -Force
2022-09-20 02:04:25 +09:00
# pwsh
New-Item -ItemType SymbolicLink -Path $PROFILE -Target (Resolve-Path .\dotfiles\pwsh\powershell_profile.ps1) -Force
2022-09-20 02:10:08 +09:00
New-Item -ItemType SymbolicLink -Path ~\.config\powershell\chezmoi_completion.ps1 -Target (Resolve-Path .\dotfiles\pwsh\chezmoi_completion.ps1) -Force
2022-09-20 02:21:10 +09:00
# starship
New-Item -ItemType SymbolicLink -Path ~\.config\starship.toml -Target (Resolve-Path .\dotfiles\starship\starship.toml) -Force