From b9ef49b51c6e2570ef3aae824ab44374997b6b25 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 4 Feb 2019 23:23:16 +0100 Subject: [feat] add -disable-autostart flag and config Make possible to disable the autostart configuration for the next run. I can be done by configuring "DisableAustostart" to true in the systra.json or by passing the '-disable-autostart' flag to the binary. To make that possible I have rework how the Config struct work separating the file configuration with the runtime configuration. - Resolves: #100 --- pkg/bitmask/autostart.go | 6 +++--- pkg/bitmask/bitmaskd.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/bitmask') diff --git a/pkg/bitmask/autostart.go b/pkg/bitmask/autostart.go index ebab428..32b931a 100644 --- a/pkg/bitmask/autostart.go +++ b/pkg/bitmask/autostart.go @@ -21,12 +21,12 @@ type Autostart interface { Enable() error } -type dummyAutostart struct{} +type DummyAutostart struct{} -func (a *dummyAutostart) Disable() error { +func (a *DummyAutostart) Disable() error { return nil } -func (a *dummyAutostart) Enable() error { +func (a *DummyAutostart) Enable() error { return nil } diff --git a/pkg/bitmask/bitmaskd.go b/pkg/bitmask/bitmaskd.go index 04b965c..a8c4e5d 100644 --- a/pkg/bitmask/bitmaskd.go +++ b/pkg/bitmask/bitmaskd.go @@ -40,5 +40,5 @@ func Init(printer *message.Printer) (Bitmask, error) { // NewAutostart creates a handler for the autostart of your platform func NewAutostart(appName string, iconPath string) Autostart { - return &dummyAutostart{} + return &DummyAutostart{} } -- cgit v1.2.3