aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2024-06-11 01:17:26 +0200
committersrdusr <trevorgray@srdusr.com>2024-06-11 01:17:26 +0200
commit46540b5db192df2a6a61f01293239e940fde3123 (patch)
tree7210ce304d6d6d8f69b64df6a8e12e6f4b9cc120 /.config
parentaf8af06a84809ba997c0c104db8ae7ee4532198a (diff)
downloaddotfiles-46540b5db192df2a6a61f01293239e940fde3123.tar.gz
dotfiles-46540b5db192df2a6a61f01293239e940fde3123.zip
Testing
Diffstat (limited to '.config')
-rw-r--r--.config/powershell/bootstrap.ps154
1 files changed, 20 insertions, 34 deletions
diff --git a/.config/powershell/bootstrap.ps1 b/.config/powershell/bootstrap.ps1
index cc7b79d..3d95afa 100644
--- a/.config/powershell/bootstrap.ps1
+++ b/.config/powershell/bootstrap.ps1
@@ -100,43 +100,29 @@ if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
Write-Host "Installing Applications"
Write-Host "----------------------------------------"
-# List of applications to install
-$apps = @(
- "git",
- "ripgrep",
- "fd",
- "sudo",
- "win32yank",
- "microsoft-windows-terminal",
- "wsl",
- "firefox",
- "setdefaultbrowser",
- "nodejs",
- "bat",
- "7zip",
- "python",
- "adobereader",
- "javaruntime",
- "autohotkey",
- "bitwarden",
- "notepadplusplus",
- "neovim"
-)
-
-foreach ($app in $apps) {
- # Check if the application is already installed
- if (-not (choco list --local-only | Select-String -Pattern "^$app\s")) {
- Write-Host "Installing $app"
- choco install $app -y
-
- if ($LASTEXITCODE -ne 0) {
- handle_error "Installation of $app failed."
+# Load packages.yml
+$packagesFile = "$HOME\packages.yml"
+$packages = Get-Content $packagesFile | ConvertFrom-Yaml
+
+# Ensure 'windows' section exists and has applications listed
+if ($packages.windows) {
+ foreach ($app in $packages.windows) {
+ # Check if the application is already installed
+ if (-not (choco list --local-only | Select-String -Pattern "^$app\s")) {
+ Write-Host "Installing $app"
+ choco install $app -y
+
+ if ($LASTEXITCODE -ne 0) {
+ handle_error "Installation of $app failed."
+ } else {
+ Write-Host "$app installed successfully."
+ }
} else {
- Write-Host "$app installed successfully."
+ Write-Host "$app is already installed."
}
- } else {
- Write-Host "$app is already installed."
}
+} else {
+ Write-Host "No applications specified under the 'windows' section in $packagesFile."
}
# Set Chrome as default browser ------------------------