diff --git a/bin/install.ps1 b/bin/install.ps1 index 548cb9f..d5f9a10 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -34,7 +34,7 @@ if(!(Get-Command scoop -ErrorAction SilentlyContinue)) { # install basic scoop apps # import from exported json file # to update the json file, execute ./bin/scoop_apps/update_scoop_list.ps1 -scoop import .\bin\scoop_apps\scoop_apps.json +scoop import .\bin\scoop_apps\scoop_minimal_apps.json # make symbolic links diff --git a/bin/scoop_apps/scoop_apps.json b/bin/scoop_apps/scoop_apps.json index 4576430..f62b40d 100644 --- a/bin/scoop_apps/scoop_apps.json +++ b/bin/scoop_apps/scoop_apps.json @@ -49,6 +49,20 @@ "Updated": "2022-09-24T06:43:31.7789266+09:00", "Version": "0.10.0" }, + { + "Info": "", + "Source": "main", + "Name": "jid", + "Updated": "2022-09-27T07:30:16.5298145+09:00", + "Version": "0.7.6" + }, + { + "Info": "", + "Source": "main", + "Name": "jq", + "Updated": "2022-09-27T07:29:37.5227478+09:00", + "Version": "1.6" + }, { "Info": "", "Source": "main", @@ -63,6 +77,13 @@ "Updated": "2022-09-25T00:17:18.2293504+09:00", "Version": "4.3" }, + { + "Info": "", + "Source": "extras", + "Name": "spacesniffer", + "Updated": "2022-09-27T07:27:52.6696127+09:00", + "Version": "1.3.0.2" + }, { "Info": "", "Source": "main", @@ -79,6 +100,12 @@ } ], "buckets": [ + { + "Name": "extras", + "Source": "https://github.com/ScoopInstaller/Extras", + "Updated": "2022-09-27T05:32:10+09:00", + "Manifests": 1691 + }, { "Name": "main", "Source": "https://github.com/ScoopInstaller/Main", diff --git a/bin/scoop_apps/scoop_minimal_apps.json b/bin/scoop_apps/scoop_minimal_apps.json new file mode 100644 index 0000000..8c611d9 --- /dev/null +++ b/bin/scoop_apps/scoop_minimal_apps.json @@ -0,0 +1,74 @@ +{ + "apps": [ + { + "Info": "", + "Source": "main", + "Name": "7zip", + "Updated": "2022-09-24T06:50:10.362148+09:00", + "Version": "22.01" + }, + { + "Info": "", + "Source": "main", + "Name": "bat", + "Updated": "2022-09-24T06:45:30.615827+09:00", + "Version": "0.22.1" + }, + { + "Info": "", + "Source": "main", + "Name": "fzf", + "Updated": "2022-09-23T17:54:45.7302151+09:00", + "Version": "0.33.0" + }, + { + "Info": "", + "Source": "main", + "Name": "grep", + "Updated": "2022-09-24T06:50:11.9515886+09:00", + "Version": "3.7" + }, + { + "Info": "", + "Source": "main", + "Name": "hexyl", + "Updated": "2022-09-24T06:43:31.7789266+09:00", + "Version": "0.10.0" + }, + { + "Info": "", + "Source": "main", + "Name": "less", + "Updated": "2022-09-23T17:59:11.0595712+09:00", + "Version": "608" + }, + { + "Info": "", + "Source": "main", + "Name": "sudo", + "Updated": "2022-09-22T23:40:06.1651065+09:00", + "Version": "0.2020.01.26" + }, + { + "Info": "", + "Source": "main", + "Name": "ugrep", + "Updated": "2022-09-24T06:53:20.806641+09:00", + "Version": "3.9.2" + } + ], + "buckets": [ + { + "Name": "extras", + "Source": "https://github.com/ScoopInstaller/Extras", + "Updated": "2022-09-27T05:32:10+09:00", + "Manifests": 1691 + }, + { + "Name": "main", + "Source": "https://github.com/ScoopInstaller/Main", + "Updated": "2022-09-27T05:30:16+09:00", + "Manifests": 1086 + } + ] +} diff --git a/bin/scoop_apps/update_scoop_list.ps1 b/bin/scoop_apps/update_scoop_list.ps1 index 1c32958..bdfcb4f 100644 --- a/bin/scoop_apps/update_scoop_list.ps1 +++ b/bin/scoop_apps/update_scoop_list.ps1 @@ -1,7 +1,29 @@ # update scoop list + +# scoop need to be installed if(!(Get-Command scoop -ErrorAction SilentlyContinue)) { Write-Output "scoop does not exists!" exit 1 } -scoop export | Out-File scoop_apps.json -Encoding utf8 +# execution location +if(!((Test-Path bin) -and (Test-Path dotfiles))) { + Write-Warning "This script need to be executed in dotfiles root" + exit 2 +} + + +# export to JSON +scoop export | Out-File .\bin\scoop_apps\scoop_apps.json -Encoding utf8 + +# create minimal JSON +$minimal_list = @("7zip", "bat", "fzf", "grep", "hexyl", "less", "sudo", "ugrep") +$parsed_json = Get-Content -Path .\bin\scoop_apps\scoop_apps.json | ConvertFrom-Json +$buckets = ($parsed_json | Select-Object buckets).buckets +$apps = ($parsed_json | Select-Object apps).apps +$selected_apps = $apps | Where-Object Name -In $minimal_list +$new_json = [PSCustomObject]@{ + "apps" = $selected_apps + "buckets" = $buckets +} +ConvertTo-Json -InputObject $new_json | Out-File .\bin\scoop_apps\scoop_minimal_apps.json -Encoding utf8 \ No newline at end of file