mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 08:49:30 -05:00
Merge pull request #1413 from mig5/cli_allow_persistent_mode_as_only_arg
Don't force mode to be sent in CLI if --persistent is in use. Store the persistent mode only the first time the persistent file is created
This commit is contained in:
commit
3d698d0fb7
@ -201,15 +201,6 @@ def main(cwd=None):
|
||||
disable_csp = bool(args.disable_csp)
|
||||
verbose = bool(args.verbose)
|
||||
|
||||
if receive:
|
||||
mode = "receive"
|
||||
elif website:
|
||||
mode = "website"
|
||||
elif chat:
|
||||
mode = "chat"
|
||||
else:
|
||||
mode = "share"
|
||||
|
||||
# Verbose mode?
|
||||
common.verbose = verbose
|
||||
|
||||
@ -223,16 +214,26 @@ def main(cwd=None):
|
||||
if persistent_filename:
|
||||
mode_settings = ModeSettings(common, persistent_filename)
|
||||
mode_settings.set("persistent", "enabled", True)
|
||||
mode_settings.set("persistent", "mode", mode)
|
||||
else:
|
||||
mode_settings = ModeSettings(common)
|
||||
|
||||
if receive:
|
||||
mode = "receive"
|
||||
elif website:
|
||||
mode = "website"
|
||||
elif chat:
|
||||
mode = "chat"
|
||||
else:
|
||||
mode = "share"
|
||||
|
||||
if mode_settings.just_created:
|
||||
# This means the mode settings were just created, not loaded from disk
|
||||
mode_settings.set("general", "title", title)
|
||||
mode_settings.set("general", "public", public)
|
||||
mode_settings.set("general", "autostart_timer", autostart_timer)
|
||||
mode_settings.set("general", "autostop_timer", autostop_timer)
|
||||
if persistent_filename:
|
||||
mode_settings.set("persistent", "mode", mode)
|
||||
if mode == "share":
|
||||
mode_settings.set("share", "autostop_sharing", autostop_sharing)
|
||||
if mode == "receive":
|
||||
|
Loading…
Reference in New Issue
Block a user