diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 5169233..2ca677f 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -19,8 +19,8 @@ type Item struct { Installer InstallerItem `yaml:"installer"` Uninstaller InstallerItem `yaml:"uninstaller"` Version string `yaml:"version"` - BlockingApps []string `yaml:"blocking_apps"` - PreScript string `yaml:"preinstall_script"` + BlockingApps []string `yaml:"blocking_apps"` + PreScript string `yaml:"preinstall_script"` PostScript string `yaml:"postinstall_script"` } diff --git a/pkg/config/config.go b/pkg/config/config.go index 49d2bfe..03cda08 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -18,20 +18,20 @@ var ( cachePath string // Define flag defaults - aboutArg bool - aboutDefault = false - configArg string - configDefault = filepath.Join(os.Getenv("ProgramData"), "gorilla/config.yaml") - debugArg bool - debugDefault = false - helpArg bool - helpDefault = false - verboseArg bool - verboseDefault = false + aboutArg bool + aboutDefault = false + configArg string + configDefault = filepath.Join(os.Getenv("ProgramData"), "gorilla/config.yaml") + debugArg bool + debugDefault = false + helpArg bool + helpDefault = false + verboseArg bool + verboseDefault = false checkOnlyArg bool checkOnlyDefault = false - versionArg bool - versionDefault = false + versionArg bool + versionDefault = false // Use a fake function so we can override when testing osExit = os.Exit diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index c03dea5..8872625 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -19,7 +19,7 @@ func TestGet(t *testing.T) { AppDataPath: filepath.Clean("c:/cpe/gorilla/"), Verbose: true, Debug: true, - CheckOnly: true, + CheckOnly: true, AuthUser: "johnny", AuthPass: "pizza", CachePath: filepath.Clean("c:/cpe/gorilla/cache"), diff --git a/pkg/gorillalog/gorillalog.go b/pkg/gorillalog/gorillalog.go index e6895d9..1a2185e 100644 --- a/pkg/gorillalog/gorillalog.go +++ b/pkg/gorillalog/gorillalog.go @@ -11,9 +11,9 @@ import ( var ( // Define these config variables at the package scope - debug bool - verbose bool - checkonly bool + debug bool + verbose bool + checkonly bool ) // TODO rewrite with io.multiwriter diff --git a/pkg/report/report.go b/pkg/report/report.go index 7557a06..96abc5b 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -86,11 +86,13 @@ func End() { } -func Print () { +// Print writes the report to stdout instead of writing to disk +// Used in check only mode +func Print() { // Compile everything Items["InstalledItems"] = InstalledItems Items["UninstalledItems"] = UninstalledItems - + reportJSON, marshalErr := json.MarshalIndent(Items, "", " ") fmt.Println(string(reportJSON)) if marshalErr != nil { diff --git a/pkg/status/registry.go b/pkg/status/registry.go index 11cf991..06c87b4 100644 --- a/pkg/status/registry.go +++ b/pkg/status/registry.go @@ -34,10 +34,10 @@ func getUninstallKeys() (installedItems map[string]RegistryApplication, checkErr // Both Uninstall paths (64 & 32 bits apps) regPaths := []string{`Software\Microsoft\Windows\CurrentVersion\Uninstall`, - `Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall`} + `Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall`} for _, regPath := range regPaths { - + // Get the Uninstall key from HKLM key, checkErr := registry.OpenKey(registry.LOCAL_MACHINE, regPath, registry.READ) if checkErr != nil {