feat: new init

This commit is contained in:
2022-01-16 12:12:34 +08:00
parent 4fd7f2ed67
commit 2f592f96c9
4 changed files with 41 additions and 4 deletions
Regular → Executable
+29 -3
View File
@@ -1,6 +1,32 @@
#!/usr/bin/env python3
import os
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-i","--install", help="install tools",type=str)
args = parser.parse_args()
install_val = args.install
if install_val == "":
print("install value is empty")
exit()
if install_val in install_map:
install_map.get(args.install)()
else:
print("cmd not support, install: "+args.install)
# install neovim
os.chdir("/usr/local")
os.system("wget https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-macos.tar.gz")
os.system("tar zxf nvim-macos.tar.gz")
def install_neovim():
os.chdir("/usr/local")
os.system("wget https://github.com/neovim/neovim/releases/download/v0.6.0/nvim-macos.tar.gz")
os.system("tar zxf nvim-macos.tar.gz")
os.system("ln -s /usr/local/nvim-osx64 /usr/local/nvim")
install_map = {
"neovim": install_neovim,
}
if __name__ == '__main__':
main()