Decode a `-EncodedCommand` base64 (UTF-16LE) payload back to its script.
(args: string[])
| 478 | |
| 479 | /** Decode a `-EncodedCommand` base64 (UTF-16LE) payload back to its script. */ |
| 480 | function decodeEncodedCommand(args: string[]): string { |
| 481 | const i = args.indexOf('-EncodedCommand'); |
| 482 | if (i < 0) throw new Error('no -EncodedCommand in args'); |
| 483 | return Buffer.from(args[i + 1]!, 'base64').toString('utf16le'); |
| 484 | } |
| 485 | |
| 486 | describe('runUpgrade', () => { |
| 487 | it('does nothing when already up to date', async () => { |