|
|
@@ -15,6 +15,7 @@ CURRENT_DIR = pathlib.Path(__file__).parent
|
|
|
|
|
|
def main():
|
|
|
bat()
|
|
|
+ curlie()
|
|
|
delta()
|
|
|
dua()
|
|
|
dust()
|
|
|
@@ -42,6 +43,33 @@ def bat():
|
|
|
|
|
|
subprocess.run(['sudo', 'apt', 'install', 'bat', '--yes'], check=True)
|
|
|
|
|
|
+def curlie():
|
|
|
+ if platform.system() == 'Darwin':
|
|
|
+ print('$ brew install curlie')
|
|
|
+ subprocess.run(['brew', 'install', 'curlie'], check=True)
|
|
|
+ return
|
|
|
+
|
|
|
+ if subprocess.run(['dpkg', '-l', 'curlie'], stdout=subprocess.DEVNULL).returncode == 0:
|
|
|
+ print_gray('curlie package already installed')
|
|
|
+ return
|
|
|
+
|
|
|
+ client = httpx.Client()
|
|
|
+ latest = gh_latest_version(client, 'rs', 'curlie')
|
|
|
+
|
|
|
+ version = latest['tag_name'].removeprefix('v')
|
|
|
+ system = platform.system().lower()
|
|
|
+ arch = get_output(['dpkg', '--print-architecture'])
|
|
|
+ filename = f'curlie_{version}_{system}_{arch}.deb'
|
|
|
+
|
|
|
+ (asset,) = (asset for asset in latest['assets'] if asset['name'] == filename)
|
|
|
+ deb_path = CURRENT_DIR / 'curlie.deb'
|
|
|
+ download(client, asset['browser_download_url'], deb_path)
|
|
|
+
|
|
|
+ try:
|
|
|
+ subprocess.run(['sudo', 'dpkg', '-i', deb_path], check=True)
|
|
|
+ finally:
|
|
|
+ os.unlink(deb_path)
|
|
|
+
|
|
|
def delta():
|
|
|
if platform.system() == 'Darwin':
|
|
|
print('$ brew install git-delta')
|