raylu 1 жил өмнө
parent
commit
972b6b3f49
2 өөрчлөгдсөн 19 нэмэгдсэн , 0 устгасан
  1. 1 0
      .gitignore
  2. 18 0
      install_extras.py

+ 1 - 0
.gitignore

@@ -3,4 +3,5 @@
 /dua
 /eza
 /git-whence
+/lazygit
 /starship

+ 18 - 0
install_extras.py

@@ -17,6 +17,7 @@ def main():
 	dua()
 	eza()
 	git_whence()
+	lazygit()
 	starship()
 
 def delta():
@@ -111,6 +112,23 @@ def git_whence():
 	download(client, url, CURRENT_DIR / 'git-whence')
 	os.chmod(CURRENT_DIR / 'git-whence', 0o755)
 
+def lazygit():
+	if (CURRENT_DIR / 'lazygit').exists():
+		print('lazygit package already installed')
+		return
+
+	client = httpx.Client()
+	latest = gh_latest_version(client, 'jesseduffield', 'lazygit')
+	version = latest['name']
+	arch = platform.processor()
+	if arch == 'aarch64':
+		arch = 'arm64'
+	url = f'https://github.com/jesseduffield/lazygit/releases/download/{version}/lazygit_{version.lstrip("v")}_{platform.system()}_{arch}.tar.gz'
+	download(client, url, CURRENT_DIR / 'lazygit.tgz')
+	with tarfile.open(CURRENT_DIR / 'lazygit.tgz', 'r:gz') as tar:
+		tar.extract('lazygit', CURRENT_DIR)
+	os.unlink(CURRENT_DIR / 'lazygit.tgz')
+
 def starship():
 	if platform.system() == 'Darwin':
 		print('$ brew install starship')