From aecba302a121a003e87da46d445109c0f4454047 Mon Sep 17 00:00:00 2001 From: Masataro Asai Date: Fri, 26 Nov 2021 15:13:13 -0500 Subject: [PATCH] removing .planutils/bin/ facility --- planutils/__init__.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/planutils/__init__.py b/planutils/__init__.py index 71deaa2..89c5448 100644 --- a/planutils/__init__.py +++ b/planutils/__init__.py @@ -26,46 +26,6 @@ def setup(): return minimal_setup() - os.mkdir(os.path.join(os.path.expanduser('~'), '.planutils', 'bin')) - - print("Adding bin folder to path (assuming ~/.bashrc exists)...") - with open(os.path.join(os.path.expanduser('~'), '.bashrc'), "a+") as f: - f.write("export PLANUTILS_PREFIX=\"~/.planutils\"\n") - f.write("export PATH=\"$PLANUTILS_PREFIX/bin:$PATH\"\n") - - print("Installing package scripts...") - for p in PACKAGES: - if PACKAGES[p]['runnable']: - script = "#!/bin/bash\n" - script += "if $(planutils check-installed %s)\n" % p - script += "then\n" - script += " ~/.planutils/packages/%s/run $@\n" % p - script += "else\n" - script += " echo\n" - script += " echo 'Package not installed!'\n" - script += " read -r -p \" Download & install? [Y/n] \" varchoice\n" - script += " varchoice=${varchoice,,}\n" # tolower - script += " if ! [[ \"$varchoice\" =~ ^(no|n)$ ]]\n" - script += " then\n" - script += " if planutils install %s;\n" % p - script += " then\n" - script += " echo 'Successfully installed %s!'\n" % p - script += " echo\n" - script += " echo \"Original command: %s $@\"\n" % p - script += " read -r -p \" Re-run command? [Y/n] \" varchoice\n" - script += " varchoice=${varchoice,,}\n" # tolower - script += " if ! [[ \"$varchoice\" =~ ^(no|n)$ ]]\n" - script += " then\n" - script += " ~/.planutils/packages/%s/run $@\n" % p - script += " fi\n" - script += " fi\n" - script += " fi\n" - script += " echo\n" - script += "fi\n" - with open(os.path.join(os.path.expanduser('~'), '.planutils', 'bin', p), 'w') as f: - f.write(script) - os.chmod(os.path.join(os.path.expanduser('~'), '.planutils', 'bin', p), 0o0755) - print("\nAll set! Be sure to start a new bash session or update your PATH variable to include ~/.planutils/bin\n")