lol

yaziPlugins: update on 2025-06-06 (#414418)

authored by

Austin Horstman and committed by
GitHub
e9a3f3ca 03365010

+240 -84
+3 -3
pkgs/by-name/ya/yazi/plugins/mediainfo/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "mediainfo.yazi"; 8 - version = "25.5.28-unstable-2025-05-30"; 8 + version = "25.5.31-unstable-2025-06-05"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "boydaihungst"; 12 12 repo = "mediainfo.yazi"; 13 - rev = "c6d0de764f6e667c1a7a49f8acc9030c02a1a45c"; 14 - hash = "sha256-CVHY66AcOC0STi+uDwbKe+HI3WN7MPgszlFHB479V/E="; 13 + rev = "a7d1aa69a1a107e64540c17f19ac94be1366769f"; 14 + hash = "sha256-HUD8Sv1C4gzZRvSEIYqcmm+A0mBYDuwZHCNH26kipS0="; 15 15 }; 16 16 17 17 meta = {
+3 -3
pkgs/by-name/ya/yazi/plugins/projects/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "projects.yazi"; 8 - version = "0-unstable-2025-05-29"; 8 + version = "0-unstable-2025-06-03"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "MasouShizuka"; 12 12 repo = "projects.yazi"; 13 - rev = "96af237d2255d5dab5493c020f55561f63c28777"; 14 - hash = "sha256-N8XH6adXPk/iU173fXEViv0NPwFZ0WYiyEJGBs4c6ec="; 13 + rev = "7037dd5eee184ccb7725bdc9f7ea6faa188420d5"; 14 + hash = "sha256-Lc0MeiAuPgJTq4ojNw9hwxqPJ74S4ymn4uPTkxGeZGc="; 15 15 }; 16 16 17 17 meta = {
+3 -3
pkgs/by-name/ya/yazi/plugins/relative-motions/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "relative-motions.yazi"; 8 - version = "25.4.8-unstable-2025-04-16"; 8 + version = "25.5.28-unstable-2025-06-05"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "dedukun"; 12 12 repo = "relative-motions.yazi"; 13 - rev = "ce2e890227269cc15cdc71d23b35a58fae6d2c27"; 14 - hash = "sha256-Ijz1wYt+L+24Fb/rzHcDR8JBv84z2UxdCIPqTdzbD14="; 13 + rev = "2e3b6172e6226e0db96aea12d09dea2d2e443fea"; 14 + hash = "sha256-v0e06ieBKNmt9DATdL7R4AyVFa9DlNBwpfME3LHozLA="; 15 15 }; 16 16 17 17 meta = {
+3 -3
pkgs/by-name/ya/yazi/plugins/rich-preview/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "rich-preview.yazi"; 8 - version = "0-unstable-2025-05-30"; 8 + version = "0-unstable-2025-05-31"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "AnirudhG07"; 12 12 repo = "rich-preview.yazi"; 13 - rev = "de28f504f21ee78b9e4799f116df2aa177384229"; 14 - hash = "sha256-pJ5aMAECK0M4v/8czGP5RZygfRAyS9IdQCeP3ZP1Gcs="; 13 + rev = "843c3faf0a99f5ce31d02372c868d8dae92ca29d"; 14 + hash = "sha256-celObHo9Y3pFCd1mTx1Lz77Tc22SJTleRblAkbH/RqY="; 15 15 }; 16 16 17 17 meta = {
+3 -3
pkgs/by-name/ya/yazi/plugins/rsync/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "rsync.yazi"; 8 - version = "0-unstable-2025-04-24"; 8 + version = "0-unstable-2025-06-07"; 9 9 src = fetchFromGitHub { 10 10 owner = "GianniBYoung"; 11 11 repo = "rsync.yazi"; 12 - rev = "ed7b7f9de971ecd8376d7ccb7a6d0d6f979c1dcb"; 13 - hash = "sha256-xAhkDTNi0MjHqESKk8j60WABYvaF7NElO2W/rsL2w2Y="; 12 + rev = "782481e58316f4b422f5c259f07c63b940555246"; 13 + hash = "sha256-ZrvaJl3nf/CGavvk1QEyOMUbfKQ/JYSmZguvbXIIw9M="; 14 14 }; 15 15 16 16 meta = {
+3 -3
pkgs/by-name/ya/yazi/plugins/starship/default.nix
··· 5 5 }: 6 6 mkYaziPlugin { 7 7 pname = "starship.yazi"; 8 - version = "25.4.8-unstable-2025-05-30"; 8 + version = "25.4.8-unstable-2025-06-01"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "Rolv-Apneseth"; 12 12 repo = "starship.yazi"; 13 - rev = "428d43ac0846cb1885493a1f01c049a883b70155"; 14 - hash = "sha256-YkDkMC2SJIfpKrt93W/v5R3wOrYcat7QTbPrWqIKXG8="; 13 + rev = "6a0f3f788971b155cbc7cec47f6f11aebbc148c9"; 14 + hash = "sha256-q1G0Y4JAuAv8+zckImzbRvozVn489qiYVGFQbdCxC98="; 15 15 }; 16 16 17 17 meta = {
+222 -66
pkgs/by-name/ya/yazi/plugins/update.py
··· 1 1 #!/usr/bin/env nix-shell 2 - #!nix-shell -i python3 -p python3 python3Packages.requests python3Packages.packaging nix curl git 2 + #!nix-shell -i python3 -p python3 python3Packages.requests python3Packages.packaging nix curl git argparse 3 3 4 + import argparse 5 + import json 4 6 import os 5 7 import re 6 8 import subprocess 7 9 import sys 8 10 from pathlib import Path 9 - from typing import Dict, Tuple 10 11 11 12 import requests 12 13 from packaging import version ··· 17 18 result = subprocess.run(cmd, shell=True, text=True, capture_output=capture_output) 18 19 if result.returncode != 0: 19 20 if capture_output: 20 - print(f"Error running command: {cmd}") 21 - print(f"stderr: {result.stderr}") 22 - sys.exit(1) 21 + error_msg = f"Error running command: {cmd}\nstderr: {result.stderr}" 22 + raise RuntimeError(error_msg) 23 + else: 24 + raise RuntimeError(f"Command failed: {cmd}") 23 25 return result.stdout.strip() if capture_output else "" 24 26 25 27 26 - def get_plugin_info(nixpkgs_dir: str, plugin_name: str) -> Dict[str, str]: 28 + def get_plugin_info(nixpkgs_dir: str, plugin_name: str) -> dict[str, str]: 27 29 """Get plugin repository information from Nix""" 28 30 owner = run_command(f"nix eval --raw -f {nixpkgs_dir} yaziPlugins.\"{plugin_name}\".src.owner") 29 31 repo = run_command(f"nix eval --raw -f {nixpkgs_dir} yaziPlugins.\"{plugin_name}\".src.repo") ··· 40 42 41 43 42 44 43 - def get_github_headers() -> Dict[str, str]: 45 + def get_github_headers() -> dict[str, str]: 44 46 """Create headers for GitHub API requests""" 45 47 headers = {"Accept": "application/vnd.github.v3+json"} 46 48 github_token = os.environ.get("GITHUB_TOKEN") ··· 49 51 return headers 50 52 51 53 52 - def get_default_branch(owner: str, repo: str, headers: Dict[str, str]) -> str: 54 + def get_default_branch(owner: str, repo: str, headers: dict[str, str]) -> str: 53 55 """Get the default branch name for a GitHub repository""" 54 56 api_url = f"https://api.github.com/repos/{owner}/{repo}" 55 57 ··· 63 65 print("Falling back to 'main' as default branch") 64 66 return "main" 65 67 66 - def fetch_plugin_content(owner: str, repo: str, plugin_pname: str, headers: Dict[str, str]) -> str: 68 + def fetch_plugin_content(owner: str, repo: str, plugin_pname: str, headers: dict[str, str]) -> str: 67 69 """Fetch the plugin's main.lua content from GitHub""" 68 70 default_branch = get_default_branch(owner, repo, headers) 69 71 plugin_path = f"{plugin_pname}/" if owner == "yazi-rs" else "" ··· 74 76 response.raise_for_status() 75 77 return response.text 76 78 except requests.RequestException as e: 77 - print(f"Error fetching plugin content: {e}") 78 - sys.exit(1) 79 + raise RuntimeError(f"Error fetching plugin content: {e}") 79 80 80 81 81 82 def check_version_compatibility(plugin_content: str, plugin_name: str, yazi_version: str) -> str: ··· 86 87 if required_version == "0": 87 88 print(f"No version requirement found for {plugin_name}, assuming compatible with any Yazi version") 88 89 else: 89 - # Check if the plugin is compatible with current Yazi version 90 90 if version.parse(required_version) > version.parse(yazi_version): 91 - print(f"{plugin_name} plugin requires Yazi {required_version}, but we have {yazi_version}") 92 - sys.exit(0) 91 + message = f"{plugin_name} plugin requires Yazi {required_version}, but we have {yazi_version}" 92 + print(message) 93 + raise RuntimeError(message) 93 94 94 95 return required_version 95 96 96 97 97 - def get_latest_commit(owner: str, repo: str, plugin_pname: str, headers: Dict[str, str]) -> Tuple[str, str]: 98 + def get_latest_commit(owner: str, repo: str, plugin_pname: str, headers: dict[str, str]) -> tuple[str, str]: 98 99 """Get the latest commit hash and date for the plugin""" 99 100 default_branch = get_default_branch(owner, repo, headers) 100 101 ··· 110 111 response.raise_for_status() 111 112 commit_data = response.json() 112 113 except requests.RequestException as e: 113 - print(f"Error fetching commit data: {e}") 114 - sys.exit(1) 114 + raise RuntimeError(f"Error fetching commit data: {e}") 115 115 116 116 if owner == "yazi-rs": 117 117 latest_commit = commit_data[0]["sha"] ··· 121 121 commit_date = commit_data["commit"]["committer"]["date"].split("T")[0] 122 122 123 123 if not latest_commit: 124 - print("Error: Could not get latest commit hash") 125 - sys.exit(1) 124 + raise RuntimeError("Could not get latest commit hash") 126 125 127 126 return latest_commit, commit_date 128 127 ··· 134 133 try: 135 134 new_hash = run_command(f"nix-prefetch-url --unpack --type sha256 {prefetch_url} 2>/dev/null") 136 135 137 - # If the hash is not in SRI format, convert it 138 136 if not new_hash.startswith("sha256-"): 139 - # Try to convert the hash to SRI format 140 137 new_hash = run_command(f"nix hash to-sri --type sha256 {new_hash} 2>/dev/null") 141 138 142 - # If that fails, try another approach 143 139 if not new_hash.startswith("sha256-"): 144 140 print("Warning: Failed to get SRI hash directly, trying alternative method...") 145 141 raw_hash = run_command(f"nix-prefetch-url --type sha256 {prefetch_url} 2>/dev/null") 146 142 new_hash = run_command(f"nix hash to-sri --type sha256 {raw_hash} 2>/dev/null") 147 143 except Exception as e: 148 - print(f"Error calculating hash: {e}") 149 - sys.exit(1) 144 + raise RuntimeError(f"Error calculating hash: {e}") 150 145 151 - # Verify we got a valid SRI hash 152 146 if not new_hash.startswith("sha256-"): 153 - print(f"Error: Failed to generate valid SRI hash. Output was: {new_hash}") 154 - sys.exit(1) 147 + raise RuntimeError(f"Failed to generate valid SRI hash. Output was: {new_hash}") 155 148 156 149 return new_hash 157 150 ··· 162 155 with open(file_path, 'r') as f: 163 156 return f.read() 164 157 except IOError as e: 165 - print(f"Error reading file {file_path}: {e}") 166 - sys.exit(1) 158 + raise RuntimeError(f"Error reading file {file_path}: {e}") 167 159 168 160 169 161 def write_nix_file(file_path: str, content: str) -> None: ··· 172 164 with open(file_path, 'w') as f: 173 165 f.write(content) 174 166 except IOError as e: 175 - print(f"Error writing to file {file_path}: {e}") 176 - sys.exit(1) 167 + raise RuntimeError(f"Error writing to file {file_path}: {e}") 177 168 178 169 179 170 def update_nix_file(default_nix_path: str, latest_commit: str, new_version: str, new_hash: str) -> None: 180 171 """Update the default.nix file with new version, revision and hash""" 181 172 default_nix_content = read_nix_file(default_nix_path) 182 173 183 - # Update the revision in default.nix 184 174 default_nix_content = re.sub(r'rev = "[^"]*"', f'rev = "{latest_commit}"', default_nix_content) 185 175 186 - # Update the version in default.nix 187 176 if 'version = "' in default_nix_content: 188 177 default_nix_content = re.sub(r'version = "[^"]*"', f'version = "{new_version}"', default_nix_content) 189 178 else: 190 - # Add version attribute after pname if it doesn't exist 191 179 default_nix_content = re.sub(r'(pname = "[^"]*";)', f'\\1\n version = "{new_version}";', default_nix_content) 192 180 193 - # Update hash in default.nix 194 181 if 'hash = "' in default_nix_content: 195 182 default_nix_content = re.sub(r'hash = "[^"]*"', f'hash = "{new_hash}"', default_nix_content) 196 183 elif 'fetchFromGitHub' in default_nix_content: 197 184 default_nix_content = re.sub(r'sha256 = "[^"]*"', f'sha256 = "{new_hash}"', default_nix_content) 198 185 else: 199 - print(f"Error: Could not find hash attribute in {default_nix_path}") 200 - sys.exit(1) 186 + raise RuntimeError(f"Could not find hash attribute in {default_nix_path}") 201 187 202 - # Write the updated content back to the file 203 188 write_nix_file(default_nix_path, default_nix_content) 204 189 205 - # Verify the hash was updated 206 190 updated_content = read_nix_file(default_nix_path) 207 191 if f'hash = "{new_hash}"' in updated_content or f'sha256 = "{new_hash}"' in updated_content: 208 192 print(f"Successfully updated hash to: {new_hash}") 209 193 else: 210 - print(f"Error: Failed to update hash in {default_nix_path}") 211 - sys.exit(1) 194 + raise RuntimeError(f"Failed to update hash in {default_nix_path}") 212 195 213 196 214 - def validate_environment() -> Tuple[str, str, str]: 197 + def get_all_plugins(nixpkgs_dir: str) -> list[dict[str, str]]: 198 + """Get all available Yazi plugins from the Nix expression""" 199 + try: 200 + plugin_names_json = run_command(f'nix eval --impure --json --expr "builtins.attrNames (import {nixpkgs_dir} {{}}).yaziPlugins"') 201 + plugin_names = json.loads(plugin_names_json) 202 + 203 + excluded_attrs = ["mkYaziPlugin", "override", "overrideDerivation", "overrideAttrs", "recurseForDerivations"] 204 + plugin_names = [name for name in plugin_names if name not in excluded_attrs] 205 + 206 + plugins = [] 207 + for name in plugin_names: 208 + try: 209 + pname = run_command(f'nix eval --raw -f {nixpkgs_dir} "yaziPlugins.{name}.pname"') 210 + plugins.append({ 211 + "name": name, # Attribute name in yaziPlugins set 212 + "pname": pname # Package name (used in repo paths) 213 + }) 214 + except Exception as e: 215 + print(f"Warning: Could not get pname for plugin {name}, skipping: {e}") 216 + continue 217 + 218 + return plugins 219 + except Exception as e: 220 + raise RuntimeError(f"Error getting plugin list: {e}") 221 + 222 + 223 + def validate_environment(plugin_name: str | None = None, plugin_pname: str | None = None) -> tuple[str, str | None, str | None]: 215 224 """Validate environment variables and paths""" 216 225 nixpkgs_dir = os.getcwd() 217 226 218 - plugin_name = os.environ.get("PLUGIN_NAME") 219 - plugin_pname = os.environ.get("PLUGIN_PNAME") 220 - 221 - if not plugin_name or not plugin_pname: 222 - print("Error: PLUGIN_NAME and PLUGIN_PNAME environment variables must be set") 223 - sys.exit(1) 227 + if plugin_name and not plugin_pname: 228 + raise RuntimeError(f"pname not provided for plugin {plugin_name}") 224 229 225 - plugin_dir = f"{nixpkgs_dir}/pkgs/by-name/ya/yazi/plugins/{plugin_name}" 226 - if not Path(f"{plugin_dir}/default.nix").exists(): 227 - print(f"Error: Could not find default.nix for plugin {plugin_name} at {plugin_dir}") 228 - sys.exit(1) 230 + if plugin_name: 231 + plugin_dir = f"{nixpkgs_dir}/pkgs/by-name/ya/yazi/plugins/{plugin_name}" 232 + if not Path(f"{plugin_dir}/default.nix").exists(): 233 + raise RuntimeError(f"Could not find default.nix for plugin {plugin_name} at {plugin_dir}") 229 234 230 235 return nixpkgs_dir, plugin_name, plugin_pname 231 236 232 237 233 - def main(): 234 - """Main function to update a Yazi plugin""" 235 - # Basic setup and validation 236 - nixpkgs_dir, plugin_name, plugin_pname = validate_environment() 238 + def update_single_plugin(nixpkgs_dir: str, plugin_name: str, plugin_pname: str) -> dict[str, str] | None: 239 + """Update a single Yazi plugin 240 + 241 + Returns: 242 + dict with update info including old_version, new_version, etc. or None if no change 243 + """ 237 244 plugin_dir = f"{nixpkgs_dir}/pkgs/by-name/ya/yazi/plugins/{plugin_name}" 238 245 default_nix_path = f"{plugin_dir}/default.nix" 239 246 240 - # Get repository info 247 + nix_content = read_nix_file(default_nix_path) 248 + old_version_match = re.search(r'version = "([^"]*)"', nix_content) 249 + old_version = old_version_match.group(1) if old_version_match else "unknown" 250 + old_commit_match = re.search(r'rev = "([^"]*)"', nix_content) 251 + old_commit = old_commit_match.group(1) if old_commit_match else "unknown" 252 + 241 253 plugin_info = get_plugin_info(nixpkgs_dir, plugin_name) 242 254 owner = plugin_info["owner"] 243 255 repo = plugin_info["repo"] 244 256 245 - # Get Yazi version separately 246 257 yazi_version = get_yazi_version(nixpkgs_dir) 247 258 248 - # Setup GitHub API headers 249 259 headers = get_github_headers() 250 260 251 - # Check plugin compatibility with current Yazi version 252 261 plugin_content = fetch_plugin_content(owner, repo, plugin_pname, headers) 253 262 required_version = check_version_compatibility(plugin_content, plugin_name, yazi_version) 254 263 255 - # Get latest commit info 256 264 latest_commit, commit_date = get_latest_commit(owner, repo, plugin_pname, headers) 257 - print(f"Updating {plugin_name} to commit {latest_commit} ({commit_date})") 265 + print(f"Checking {plugin_name} latest commit {latest_commit} ({commit_date})") 258 266 259 - # Generate new version string 267 + if latest_commit == old_commit: 268 + print(f"No changes for {plugin_name}, already at latest commit {latest_commit}") 269 + return None 270 + 271 + print(f"Updating {plugin_name} from commit {old_commit} to {latest_commit}") 272 + 260 273 new_version = f"{required_version}-unstable-{commit_date}" 261 274 262 - # Calculate hash for the plugin 263 275 new_hash = calculate_sri_hash(owner, repo, latest_commit) 264 276 print(f"Generated SRI hash: {new_hash}") 265 277 266 - # Update the default.nix file 267 278 update_nix_file(default_nix_path, latest_commit, new_version, new_hash) 268 279 269 - print(f"Successfully updated {plugin_name} to version {new_version} (commit {latest_commit})") 280 + print(f"Successfully updated {plugin_name} from {old_version} to {new_version}") 281 + 282 + return { 283 + "name": plugin_name, 284 + "old_version": old_version, 285 + "new_version": new_version, 286 + "old_commit": old_commit, 287 + "new_commit": latest_commit 288 + } 289 + 290 + 291 + def update_all_plugins(nixpkgs_dir: str) -> list[dict[str, str]]: 292 + """Update all available Yazi plugins 293 + 294 + Returns: 295 + list[dict[str, str]]: List of successfully updated plugin info dicts 296 + """ 297 + plugins = get_all_plugins(nixpkgs_dir) 298 + updated_plugins = [] 299 + 300 + if not plugins: 301 + print("No plugins found to update") 302 + return updated_plugins 303 + 304 + print(f"Found {len(plugins)} plugins to update") 305 + 306 + checked_count = 0 307 + updated_count = 0 308 + failed_plugins = [] 309 + 310 + for plugin in plugins: 311 + plugin_name = plugin["name"] 312 + plugin_pname = plugin["pname"] 313 + 314 + try: 315 + print(f"\n{'=' * 50}") 316 + print(f"Checking plugin: {plugin_name}") 317 + print(f"{'=' * 50}") 318 + 319 + try: 320 + update_info = update_single_plugin(nixpkgs_dir, plugin_name, plugin_pname) 321 + checked_count += 1 322 + 323 + if update_info: 324 + updated_count += 1 325 + updated_plugins.append(update_info) 326 + except KeyboardInterrupt: 327 + print("\nUpdate process interrupted by user") 328 + sys.exit(1) 329 + except Exception as e: 330 + print(f"Error updating plugin {plugin_name}: {e}") 331 + failed_plugins.append({"name": plugin_name, "error": str(e)}) 332 + continue 333 + except Exception as e: 334 + print(f"Unexpected error with plugin {plugin_name}: {e}") 335 + failed_plugins.append({"name": plugin_name, "error": str(e)}) 336 + continue 337 + 338 + print(f"\n{'=' * 50}") 339 + print(f"Update summary: {updated_count} plugins updated out of {checked_count} checked") 340 + 341 + if updated_count > 0: 342 + print("\nUpdated plugins:") 343 + for plugin in updated_plugins: 344 + print(f" - {plugin['name']}: {plugin['old_version']} → {plugin['new_version']}") 345 + 346 + if failed_plugins: 347 + print(f"\nFailed to update {len(failed_plugins)} plugins:") 348 + for plugin in failed_plugins: 349 + print(f" - {plugin['name']}: {plugin['error']}") 350 + 351 + return updated_plugins 352 + 353 + 354 + def commit_changes(updated_plugins: list[dict[str, str]]) -> None: 355 + """Commit all changes after updating plugins""" 356 + if not updated_plugins: 357 + print("No plugins were updated, skipping commit") 358 + return 359 + 360 + try: 361 + status_output = run_command("git status --porcelain", capture_output=True) 362 + if not status_output: 363 + print("No changes to commit") 364 + return 365 + 366 + current_date = run_command("date +%Y-%m-%d", capture_output=True) 367 + 368 + if len(updated_plugins) == 1: 369 + plugin = updated_plugins[0] 370 + commit_message = f"yaziPlugins.{plugin['name']}: update from {plugin['old_version']} to {plugin['new_version']}" 371 + else: 372 + commit_message = f"yaziPlugins: update on {current_date}\n\n" 373 + for plugin in sorted(updated_plugins, key=lambda x: x['name']): 374 + commit_message += f"- {plugin['name']}: {plugin['old_version']} → {plugin['new_version']}\n" 375 + 376 + run_command("git add pkgs/by-name/ya/yazi/plugins/", capture_output=False) 377 + 378 + run_command(f'git commit -m "{commit_message}"', capture_output=False) 379 + print(f"\nCommitted changes with message: {commit_message}") 380 + except Exception as e: 381 + print(f"Error committing changes: {e}") 382 + 383 + 384 + def main(): 385 + """Main function to update Yazi plugins""" 386 + 387 + parser = argparse.ArgumentParser(description="Update Yazi plugins") 388 + group = parser.add_mutually_exclusive_group() 389 + group.add_argument("--all", action="store_true", help="Update all Yazi plugins") 390 + group.add_argument("--plugin", type=str, help="Update a specific plugin by name") 391 + parser.add_argument("--commit", action="store_true", help="Commit changes after updating") 392 + args = parser.parse_args() 393 + 394 + nixpkgs_dir = os.getcwd() 395 + updated_plugins = [] 396 + 397 + if args.all: 398 + print("Updating all Yazi plugins...") 399 + updated_plugins = update_all_plugins(nixpkgs_dir) 400 + 401 + elif args.plugin: 402 + plugin_name = args.plugin 403 + try: 404 + plugin_pname = run_command(f'nix eval --raw -f {nixpkgs_dir} "yaziPlugins.{plugin_name}.pname"') 405 + print(f"Updating Yazi plugin: {plugin_name}") 406 + update_info = update_single_plugin(nixpkgs_dir, plugin_name, plugin_pname) 407 + if update_info: 408 + updated_plugins.append(update_info) 409 + except Exception as e: 410 + print(f"Error: {e}") 411 + sys.exit(1) 412 + else: 413 + nixpkgs_dir, plugin_name, plugin_pname = validate_environment() 414 + 415 + if plugin_name and plugin_pname: 416 + print(f"Updating Yazi plugin: {plugin_name}") 417 + update_info = update_single_plugin(nixpkgs_dir, plugin_name, plugin_pname) 418 + if update_info: 419 + updated_plugins.append(update_info) 420 + else: 421 + parser.print_help() 422 + sys.exit(0) 423 + 424 + if args.commit and updated_plugins: 425 + commit_changes(updated_plugins) 270 426 271 427 272 428 if __name__ == "__main__":