|
|
@@ -25,6 +25,7 @@ def main():
|
|
|
lazygit()
|
|
|
oh_my_posh()
|
|
|
#starship()
|
|
|
+ uv()
|
|
|
yazi()
|
|
|
|
|
|
def bat():
|
|
|
@@ -267,6 +268,32 @@ def starship():
|
|
|
tar.extract('starship', CURRENT_DIR)
|
|
|
tarball_path.unlink()
|
|
|
|
|
|
+def uv():
|
|
|
+ if (CURRENT_DIR / 'uv').exists():
|
|
|
+ print_gray('uv already downloaded')
|
|
|
+ return
|
|
|
+ if which := shutil.which('uv'):
|
|
|
+ print_gray('uv already at ' + which)
|
|
|
+ return
|
|
|
+
|
|
|
+ client = httpx.Client()
|
|
|
+ os = platform.system().lower()
|
|
|
+ arch = platform.machine()
|
|
|
+ if arch == 'darwin':
|
|
|
+ prefix = f'uv-{arch}-apple-darwin'
|
|
|
+ else:
|
|
|
+ prefix = f'uv-{arch}-unknown-linux-gnu'
|
|
|
+ url = f'https://github.com/astral-sh/uv/releases/latest/download/{prefix}.tar.gz'
|
|
|
+ tarball_path = CURRENT_DIR / 'uv.tar.gz'
|
|
|
+ download(client, url, tarball_path)
|
|
|
+ with tarfile.open(tarball_path, 'r:gz') as tar:
|
|
|
+ for filename in ['uv', 'uvx']:
|
|
|
+ target_path = CURRENT_DIR / filename
|
|
|
+ with tar.extractfile(f'{prefix}/{filename}') as binary, target_path.open('wb') as f: # pyright: ignore[reportOptionalContextManager]
|
|
|
+ shutil.copyfileobj(binary, f)
|
|
|
+ target_path.chmod(0o755)
|
|
|
+ tarball_path.unlink()
|
|
|
+
|
|
|
def yazi():
|
|
|
if platform.system() == 'Darwin':
|
|
|
print('$ brew install yazi')
|