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CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;mDAcqC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n  cleanSolanaTestValidatorCache,\n  installSolanaTestValidator,\n  parseSolanaTestValidatorInstallCliOptions,\n  readSolanaTestValidatorInstallOptionsFromPackageJson,\n} from '../install';\n\nasync function main(): Promise<void> {\n  const [command, ...args] = process.argv.slice(2);\n\n  if (command === '--help' || command === 'help') {\n    printHelp();\n    return;\n  }\n\n  if (command === 'cache' && args[0] === 'clean') {\n    await cleanSolanaTestValidatorCache({\n      ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n      ...parseSolanaTestValidatorInstallCliOptions(args.slice(1)),\n    });\n    console.log('[solana-test-validator-up] cache cleaned');\n    return;\n  }\n\n  const installArgs = command === 'install' ? args : process.argv.slice(2);\n  const result = await installSolanaTestValidator({\n    ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n    ...parseSolanaTestValidatorInstallCliOptions(installArgs),\n  });\n\n  console.log(\n    `[solana-test-validator-up] Solana release ${\n      result.cacheHit ? 'found in cache' : 'installed'\n    }`,\n  );\n  console.log(\n    `[solana-test-validator-up] solana-test-validator installed at ${result.binaryPath}`,\n  );\n}\n\nmain().catch((error) => {\n  console.error(error);\n  process.exit(1);\n});\n\nfunction printHelp(): void {\n  console.log(`Usage: solana-test-validator-up [install] [options]\n       solana-test-validator-up cache clean [options]\n\nCommands:\n  install      Install solana-test-validator and solana CLI. Default command.\n  cache clean  Remove cached solana-test-validator-up artifacts.\n\nOptions:\n  --bin-directory <path>      Directory for executable wrappers.\n                               Defaults to node_modules/.bin.\n  --cache-directory <path>    Cache directory. Defaults to .metamask/cache.\n  --release-url <url>         Solana release archive URL for the current platform.\n  --release-checksum <hash>   Expected Solana release SHA-256 checksum.\n  --platform <platform>       Override platform key, e.g. linux-x64.\n  --help                      Show this help text.`);\n}\n"]}