frontend/.pnpm-store/v3/files/3d/69a26c13c980a68b7c56dbde10ce0be370e4aaed5170c1b341539f448cd2bd4b5342eac3c1a20f82b104358ab475ce2d787ae14d7d0ceddf6329a4e7cc7874

25 lines
606 B
Plaintext

import util from 'node:util';
import Shell from '../../lib/shell.js';
const debug = util.debug('release-it:shell-stub');
class ShellStub extends Shell {
exec(command) {
if (/^(npm (ping|publish|show)|git fetch)/.test(command)) {
debug(command);
return Promise.resolve();
}
if (/^npm whoami/.test(command)) {
debug(command);
return Promise.resolve('john');
}
if (/^npm access/.test(command)) {
debug(command);
return Promise.resolve(JSON.stringify({ john: ['write'] }));
}
return super.exec(...arguments);
}
}
export default ShellStub;