( argv: string[], pkgName: string = packageName )
| 101 | * Used for non-interactive "confirmation required" payloads. |
| 102 | */ |
| 103 | export function buildCommandWithYes( |
| 104 | argv: string[], |
| 105 | pkgName: string = packageName |
| 106 | ): string { |
| 107 | const args = stripSensitiveAuthArgs(argv.slice(2)); |
| 108 | const hasYes = args.some(a => a === '--yes' || a === '-y'); |
| 109 | const out = hasYes ? args : [...args, '--yes']; |
| 110 | return `${pkgName} ${out.join(' ')}`.trim(); |
| 111 | } |
| 112 | |
| 113 | /** Global flags that should be preserved in suggested "next" commands (e.g. --cwd, --non-interactive). */ |
| 114 | const GLOBAL_FLAG_NAMES = new Set([ |
no test coverage detected