Add intel-only flag for initializing intel data only

This commit is contained in:
Daniel 2022-04-12 16:40:29 +02:00
parent 295efbb3a2
commit d89609e7e7

View file

@ -11,7 +11,10 @@ import (
"github.com/safing/portmaster/updates/helper"
)
var reset bool
var (
reset bool
intelOnly bool
)
func init() {
rootCmd.AddCommand(updateCmd)
@ -19,6 +22,7 @@ func init() {
flags := updateCmd.Flags()
flags.BoolVar(&reset, "reset", false, "Delete all resources and re-download the basic set")
flags.BoolVar(&intelOnly, "intel-only", false, "Only make downloading intel updates mandatory")
}
var (
@ -49,6 +53,11 @@ func indexRequired(cmd *cobra.Command) bool {
}
func downloadUpdates() error {
// Check if only intel data is mandatory.
if intelOnly {
helper.IntelOnly()
}
// Set required updates.
registry.MandatoryUpdates = helper.MandatoryUpdates()
registry.AutoUnpack = helper.AutoUnpackUpdates()