Loading pkgs/applications/networking/instant-messengers/discord/disable-breaking-updates.py +14 −12 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME") or os.path.join( settings_path = Path(f"{XDG_CONFIG_HOME}/@configDirName@/settings.json") settings_path_temp = Path(f"{XDG_CONFIG_HOME}/@configDirName@/settings.json.tmp") try: if os.path.exists(settings_path): with settings_path.open(encoding="utf-8") as settings_file: settings = json.load(settings_file) else: settings = {} if settings.get("SKIP_HOST_UPDATE"): print("[Nix] Disabling updates already done") Loading @@ -32,11 +35,10 @@ try: skip_host_update = {"SKIP_HOST_UPDATE": True} settings.update(skip_host_update) os.makedirs(os.path.dirname(settings_path), exist_ok=True) with settings_path_temp.open("w", encoding="utf-8") as settings_file_temp: json.dump(settings, settings_file_temp, indent=2) settings_path_temp.rename(settings_path) print("[Nix] Disabled updates") except IOError: print("[Nix] settings.json doesn't yet exist, can't disable it yet") Loading
pkgs/applications/networking/instant-messengers/discord/disable-breaking-updates.py +14 −12 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME") or os.path.join( settings_path = Path(f"{XDG_CONFIG_HOME}/@configDirName@/settings.json") settings_path_temp = Path(f"{XDG_CONFIG_HOME}/@configDirName@/settings.json.tmp") try: if os.path.exists(settings_path): with settings_path.open(encoding="utf-8") as settings_file: settings = json.load(settings_file) else: settings = {} if settings.get("SKIP_HOST_UPDATE"): print("[Nix] Disabling updates already done") Loading @@ -32,11 +35,10 @@ try: skip_host_update = {"SKIP_HOST_UPDATE": True} settings.update(skip_host_update) os.makedirs(os.path.dirname(settings_path), exist_ok=True) with settings_path_temp.open("w", encoding="utf-8") as settings_file_temp: json.dump(settings, settings_file_temp, indent=2) settings_path_temp.rename(settings_path) print("[Nix] Disabled updates") except IOError: print("[Nix] settings.json doesn't yet exist, can't disable it yet")