Merge pull request #1287 from SaptakS/fix-persistent

Fixes issues with persistent mode
This commit is contained in:
Micah Lee 2021-02-22 13:26:29 -08:00 committed by GitHub
commit ee20c648c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,6 +267,7 @@ 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)
@ -292,7 +293,7 @@ def main(cwd=None):
if mode == "share" or mode == "website":
# Unless you passed in a persistent filename, in which case get the filenames from
# the mode settings
if persistent_filename and not mode_settings.just_created:
if persistent_filename and not mode_settings.just_created and len(filenames) != 0:
filenames = mode_settings.get(mode, "filenames")
else:
@ -316,6 +317,11 @@ def main(cwd=None):
if not valid:
sys.exit()
# Save the filenames in persistent file
if persistent_filename:
mode_settings.set(mode, "filenames", filenames)
# Create the Web object
web = Web(common, False, mode_settings, mode)