From cddb305fd3c88a4b1ec3b23808f6d396d8828a2e Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:53:27 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=20feat(types):=20Define=20YAML=20f?= =?UTF-8?q?ile=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 69 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 19f6638..3ebf06b 100644 --- a/main.go +++ b/main.go @@ -24,21 +24,68 @@ func initialModel() menu { } } -type SoftwareDef struct { - Bin *string `yaml:"_bin"` - Desc string `yaml:"_desc"` - Docs *string `yaml:"_docs"` - Github *string `yaml:"_github"` - Home *string `yaml:"_home"` - Name string `yaml:"_name"` - Apk *string `yaml:"apk"` - Appimage *string `yaml:"appimage"` +type YamlStructure struct { + InstallerPreferences InstallerPreferences `yaml:"installerPreferences"` + SoftwarePackages SoftwarePackages `yaml:"softwarePackages"` +} + +type InstallerPreferences struct { + Apt []string `yaml:"apt"` + Darwin []string `yaml:"darwin"` + Dnf []string `yaml:"dnf"` + Freebsd []string `yaml:"freebsd"` + Pacman []string `yaml:"pacman"` + Ubuntu []string `yaml:"ubuntu"` + Windows []string `yaml:"windows"` + Zypper []string `yaml:"zypper"` } type SoftwarePackages map[string]SoftwareDef -type YamlStructure struct { - SoftwarePackages SoftwarePackages `yaml:"softwarePackages"` +type SoftwareDef struct { + Bin *string `yaml:"_bin"` + Desc string `yaml:"_desc"` + Deps *[]string `yaml:"_deps"` + Docs *string `yaml:"_docs"` + Github *string `yaml:"_github"` + Home *string `yaml:"_home"` + Name string `yaml:"_name"` + Apk *string `yaml:"apk"` + Appimage *string `yaml:"appimage"` + Basher *string `yaml:"basher"` + Binary *osNames `yaml:"binary"` + Bpkg *string `yaml:"bpkg"` + Brew *string `yaml:"brew"` + Cargo *string `yaml:"cargo"` + Cask *string `yaml:"cask"` + Crew *string `yaml:"crew"` + Choco *string `yaml:"choco"` + Dnf *string `yaml:"dnf"` + Flatpak *string `yaml:"flatpak"` + Gem *string `yaml:"gem"` + Go *string `yaml:"go"` + Krew *string `yaml:"krew"` + Nix *string `yaml:"nix"` + Npm *string `yaml:"npm"` + Pacman *string `yaml:"pacman"` + Pipx *string `yaml:"pipx"` + PkgFreebsd *string `yaml:"pkg-freebsd"` + PkgTermux *string `yaml:"pkg-termux"` + Port *string `yaml:"port"` + Scoop *string `yaml:"scoop"` + Script *string `yaml:"string"` + Snap *string `yaml:"snap"` + Whalebrew *string `yaml:"whalebrew"` + Winget *string `yaml:"winget"` + Xbps *string `yaml:"xbps"` + Yay *string `yaml:"yay"` + Zypper *string `yaml:"zypper"` +} + +type osNames struct { + Darwin *string `yaml:"darwin"` + Linux *string `yaml:"linux"` + Windows *string `yaml:"windows"` } type yamlMsg YamlStructure