|
|
@@ -30,6 +30,7 @@ def main():
|
|
|
eza()
|
|
|
fx()
|
|
|
git_whence()
|
|
|
+ jjui()
|
|
|
jujutsu()
|
|
|
lazygit()
|
|
|
oh_my_posh()
|
|
|
@@ -240,6 +241,35 @@ def git_whence():
|
|
|
download(client, url, CURRENT_DIR / 'git-whence')
|
|
|
os.chmod(CURRENT_DIR / 'git-whence', 0o755)
|
|
|
|
|
|
+def jjui():
|
|
|
+ if (CURRENT_DIR / 'jjui').exists():
|
|
|
+ print_gray('jjui already downloaded')
|
|
|
+ return
|
|
|
+
|
|
|
+ if platform.system() == 'Darwin':
|
|
|
+ print('$ brew install jjui')
|
|
|
+ subprocess.run(['brew', 'install', 'jjui'], check=True)
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ assert platform.system() == 'Linux'
|
|
|
+
|
|
|
+ client = httpx.Client()
|
|
|
+ latest = gh_latest_version(client, 'idursun', 'jjui')
|
|
|
+ version = latest['name']
|
|
|
+
|
|
|
+ system = platform.system().lower()
|
|
|
+ arch = platform.machine()
|
|
|
+ name = f'jjui-{version}-{arch}-{system}'
|
|
|
+ url = f'https://github.com/idursun/jjui/releases/download/{version}/{name}.zip'
|
|
|
+ zip_path = CURRENT_DIR / 'jjui.zip'
|
|
|
+ download(client, url, zip_path)
|
|
|
+ with zipfile.ZipFile(zip_path, 'r') as zipf:
|
|
|
+ extracted = (CURRENT_DIR / 'jjui')
|
|
|
+ with zipf.open(name, 'r') as binary, extracted.open('wb') as f:
|
|
|
+ shutil.copyfileobj(binary, f)
|
|
|
+ extracted.chmod(0o755)
|
|
|
+ zip_path.unlink()
|
|
|
+
|
|
|
def jujutsu():
|
|
|
if (CURRENT_DIR / 'jj').exists():
|
|
|
print_gray('jj already downloaded')
|