|
|
@@ -16,6 +16,7 @@ def main():
|
|
|
bat()
|
|
|
delta()
|
|
|
dua()
|
|
|
+ dust()
|
|
|
eza()
|
|
|
git_whence()
|
|
|
lazygit()
|
|
|
@@ -90,6 +91,34 @@ def dua():
|
|
|
os.unlink(tarball_path)
|
|
|
dua_path.chmod(0o755)
|
|
|
|
|
|
+def dust():
|
|
|
+ if platform.system() == 'Darwin':
|
|
|
+ print('$ brew install dust')
|
|
|
+ subprocess.run(['brew', 'install', 'dust'], check=True)
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ assert platform.system() == 'Linux'
|
|
|
+
|
|
|
+ dust_path = CURRENT_DIR / 'dust'
|
|
|
+ if dust_path.exists():
|
|
|
+ print('dust already downloaded')
|
|
|
+ return
|
|
|
+
|
|
|
+ client = httpx.Client()
|
|
|
+ latest = gh_latest_version(client, 'bootandy', 'dust')
|
|
|
+ version = latest['name']
|
|
|
+ dirname = f'dust-{version}-{platform.machine()}-unknown-linux-musl'
|
|
|
+ filename = dirname + '.tar.gz'
|
|
|
+ (asset,) = (asset for asset in latest['assets'] if asset['name'] == filename)
|
|
|
+ tarball_path = CURRENT_DIR / 'dust.tar.gz'
|
|
|
+ download(client, asset['browser_download_url'], tarball_path)
|
|
|
+ with tarfile.open(tarball_path) as tar:
|
|
|
+ with tar.extractfile(dirname + '/dust') as binary, dust_path.open('wb') as f: # pyright: ignore[reportOptionalContextManager]
|
|
|
+ shutil.copyfileobj(binary, f)
|
|
|
+ os.unlink(tarball_path)
|
|
|
+ dust_path.chmod(0o755)
|
|
|
+
|
|
|
+
|
|
|
def eza():
|
|
|
if platform.system() == 'Darwin':
|
|
|
print('$ brew install eza')
|