frontend/.pnpm-store/v3/files/99/0697c6cfde934842f9e09a5f2174e219893bf14217a88ae59b9e172dba4290c9cb62cddbb6bd34486483f19efbec33cdc4ed04fa3980323a327f13636bea71

23 lines
585 B
Plaintext

const debug = require('debug')('release-it:shell-stub');
const Shell = require('../../lib/shell');
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);
}
}
module.exports = ShellStub;