raylu 6 сар өмнө
parent
commit
42844f4f7d
2 өөрчлөгдсөн 22 нэмэгдсэн , 0 устгасан
  1. 1 0
      .gitignore
  2. 21 0
      install_extras.py

+ 1 - 0
.gitignore

@@ -3,6 +3,7 @@
 /dua
 /dust
 /eza
+/fx
 /git-whence
 /jj
 /lazygit

+ 21 - 0
install_extras.py

@@ -18,6 +18,7 @@ def main():
 	dua()
 	dust()
 	eza()
+	fx()
 	git_whence()
 	jujutsu()
 	lazygit()
@@ -140,6 +141,26 @@ def eza():
 		tar.extract('./eza', CURRENT_DIR)
 	tarball_path.unlink()
 
+def fx():
+	if platform.system() == 'Darwin':
+		print('$ brew install fx')
+		subprocess.run(['brew', 'install', 'fx'], check=True)
+		return
+	else:
+		assert platform.system() == 'Linux'
+
+	if (CURRENT_DIR / 'fx').exists():
+		print_gray('fx already downloaded')
+		return
+
+	client = httpx.Client()
+	arch = platform.machine()
+	if arch == 'aarch64':
+		arch = 'arm64'
+	url = f'https://github.com/antonmedv/fx/releases/latest/download/fx_linux_{arch}'
+	download(client, url, CURRENT_DIR / 'fx')
+	os.chmod(CURRENT_DIR / 'fx', 0o755)
+
 def git_whence():
 	if platform.system() == 'Darwin':
 		print('$ brew install raylu/formulae/git-whence')