From bad56be7ca430bf563ffdcab20b0540dba8b3f51 Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 15 Dec 2023 14:37:54 +0000 Subject: [PATCH 1/2] Fix broken pip backup/restore --- coder-setup.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/coder-setup.py b/coder-setup.py index c66a129..3b2a770 100644 --- a/coder-setup.py +++ b/coder-setup.py @@ -1,5 +1,6 @@ import os import pathlib +import shutil import subprocess import tempfile import urllib.request @@ -49,14 +50,20 @@ def configure_git(): def backup_pip(): pip = pathlib.Path.home() / ".config" / "pip" + pip_bak = pathlib.Path.home() / ".config" / "pip.bak" + if pip_bak.exists(): + print("Removing stray backup directory...") + shutil.rmtree(pip_bak) + if pip.exists(): - pip.rename("pip.bak") + pip.rename(pip_bak) def restore_pip(): - pip = pathlib.Path.home() / ".config" / "pip.bak" - if pip.exists(): - pip.rename("pip") + pip = pathlib.Path.home() / ".config" / "pip" + pip_bak = pathlib.Path.home() / ".config" / "pip.bak" + if pip_bak.exists(): + pip_bak.rename(pip) def configure_python(): From 3322afbce3dddf440e1d5265c1cedaa34c47c72d Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 15 Dec 2023 14:38:10 +0000 Subject: [PATCH 2/2] Who knows --- .config/gh/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/gh/config.yml b/.config/gh/config.yml index f32ba6a..97cf17c 100644 --- a/.config/gh/config.yml +++ b/.config/gh/config.yml @@ -13,3 +13,4 @@ aliases: http_unix_socket: # What web browser gh should use when opening URLs. If blank, will refer to environment. browser: +version: "1"