# if platform is OS X use "~/.bash_profile" if current_platform == "darwin": bash_file = "~/.bash_profile" # if platform is Linux use "~/.bashrc elif current_platform == "linux": bash_file = "~/.bashrc" # else write and discard else: bash_file = "/dev/null" argcomplete_command = 'eval "$(register-python-argcomplete retriever)"' with open(os.path.expanduser(bash_file), "a+") as bashrc: bashrc.seek(0) # register retriever for arg-completion if not already registered # whenever a new shell is spawned if argcomplete_command not in bashrc.read(): bashrc.write(argcomplete_command + "\n") bashrc.close() os.system("activate-global-python-argcomplete") # register for the current shell os.system(argcomplete_command) try: from retriever.compile import compile from retriever.lib.repository import check_for_updates check_for_updates(False) compile() except: pass
bash_file = "~/.bashrc" # else write and discard else: bash_file = "/dev/null" argcomplete_command = 'eval "$(register-python-argcomplete retriever)"' with open(os.path.expanduser(bash_file), "a+") as bashrc: bashrc.seek(0) # register retriever for arg-completion if not already registered # whenever a new shell is spawned if argcomplete_command not in bashrc.read(): bashrc.write(argcomplete_command + "\n") bashrc.close() os.system("activate-global-python-argcomplete") # register for the current shell os.system(argcomplete_command) try: from retriever.compile import compile from retriever.lib.repository import check_for_updates from retriever.lib.defaults import HOME_DIR check_for_updates() compile() if os.path.exists(HOME_DIR): retriever_path = os.getcwd() with open(os.path.join(HOME_DIR, "retriever_path.txt"), "w+") as f: f.write(retriever_path) except: pass