Compare commits

...

2 commits

Author SHA1 Message Date
John Doty
3322afbce3 Who knows 2023-12-15 14:38:10 +00:00
John Doty
bad56be7ca Fix broken pip backup/restore 2023-12-15 14:37:54 +00:00
2 changed files with 12 additions and 4 deletions

View file

@ -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"

View file

@ -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():