raylu 5 months ago
parent
commit
f5b00da0fb
2 changed files with 23 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 22 0
      install_extras.py

+ 1 - 0
.gitignore

@@ -9,6 +9,7 @@
 /jj
 /lazygit
 /oh-my-posh
+/procs
 /starship
 /uv
 /uvx

+ 22 - 0
install_extras.py

@@ -25,6 +25,7 @@ def main():
 	jujutsu()
 	lazygit()
 	oh_my_posh()
+	procs()
 	#starship()
 	uv()
 	yazi()
@@ -273,6 +274,27 @@ def oh_my_posh():
 	download(client, url, CURRENT_DIR / 'oh-my-posh')
 	os.chmod(CURRENT_DIR / 'oh-my-posh', 0o755)
 
+def procs():
+	if (CURRENT_DIR / 'procs').exists():
+		print_gray('procs already downloaded')
+		return
+
+	client = httpx.Client()
+	latest = gh_latest_version(client, 'dalance', 'procs')
+	version = latest['name']
+
+	system = platform.system().lower()
+	name = f'procs-{version}-{platform.machine()}-{system}.zip'
+	url = f'https://github.com/dalance/procs/releases/download/{version}/{name}'
+	zip_path = CURRENT_DIR / 'procs.zip'
+	download(client, url, zip_path)
+	with zipfile.ZipFile(zip_path, 'r') as zipf:
+		extracted = (CURRENT_DIR / 'procs')
+		with zipf.open('procs', 'r') as binary, extracted.open('wb') as f:
+			shutil.copyfileobj(binary, f)
+		extracted.chmod(0o755)
+	zip_path.unlink()
+
 def starship():
 	if platform.system() == 'Darwin':
 		print('$ brew install starship')