Update profile and scoop apps

This commit is contained in:
2024-02-03 15:30:44 -04:00
parent a5992f08d6
commit 6dda286e8f
3 changed files with 530 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Sync apps with scoop
. ~/Documents/PowerShell/verify-state.ps1
# . ~/Documents/PowerShell/verify-state.ps1
scoop export | Out-File "~\scoop\apps.json"
# Shell completion
. ~/Documents/PowerShell/completions.ps1

View File

@ -10,15 +10,15 @@ function differences($required, $installed) {
if (-not (Test-Path "~\scoop\apps.json")) {
Write-Host "Scoop is installed but the apps.json file is missing"
scoop export | Out-File "~\scoop\apps.json"
}
scoop export | Out-File "~\scoop\apps.json"
# Diff the installed software with the required software, if there are differences, install the required software
$required = Get-Content "~\scoop\apps.json" | ConvertFrom-Json
$installed = scoop export | ConvertFrom-Json
$differences = differences $required.apps $installed.apps
if ($differences) {
Write-Host "The following software is missing:"
Write-Host "The following software not synced:"
$differences | ForEach-Object { Write-Host $_.InputObject }
$install = Read-Host "Would you like to install the missing software? (y/n)"
if ($install -eq "y") {