Add intel-only flag for initializing intel data only
This commit is contained in:
@@ -11,7 +11,10 @@ import (
|
|||||||
"github.com/safing/portmaster/updates/helper"
|
"github.com/safing/portmaster/updates/helper"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reset bool
|
var (
|
||||||
|
reset bool
|
||||||
|
intelOnly bool
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(updateCmd)
|
rootCmd.AddCommand(updateCmd)
|
||||||
@@ -19,6 +22,7 @@ func init() {
|
|||||||
|
|
||||||
flags := updateCmd.Flags()
|
flags := updateCmd.Flags()
|
||||||
flags.BoolVar(&reset, "reset", false, "Delete all resources and re-download the basic set")
|
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 (
|
var (
|
||||||
@@ -49,6 +53,11 @@ func indexRequired(cmd *cobra.Command) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func downloadUpdates() error {
|
func downloadUpdates() error {
|
||||||
|
// Check if only intel data is mandatory.
|
||||||
|
if intelOnly {
|
||||||
|
helper.IntelOnly()
|
||||||
|
}
|
||||||
|
|
||||||
// Set required updates.
|
// Set required updates.
|
||||||
registry.MandatoryUpdates = helper.MandatoryUpdates()
|
registry.MandatoryUpdates = helper.MandatoryUpdates()
|
||||||
registry.AutoUnpack = helper.AutoUnpackUpdates()
|
registry.AutoUnpack = helper.AutoUnpackUpdates()
|
||||||
|
|||||||
Reference in New Issue
Block a user