fix: better errors
This commit is contained in:
11
src/git.ts
11
src/git.ts
@@ -31,16 +31,6 @@ export default new (class Git {
|
|||||||
|
|
||||||
exec = (command: string): Promise<string> => {
|
exec = (command: string): Promise<string> => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (IS_TEST) {
|
|
||||||
const fullCommand = `git ${command}`;
|
|
||||||
|
|
||||||
console.log(`Skipping "${fullCommand}" because of test env`);
|
|
||||||
|
|
||||||
if (!fullCommand.includes('git remote set-url origin')) {
|
|
||||||
this.commandsRun.push(fullCommand);
|
|
||||||
}
|
|
||||||
return resolve('done');
|
|
||||||
}
|
|
||||||
let execOutput = '';
|
let execOutput = '';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
@@ -56,6 +46,7 @@ export default new (class Git {
|
|||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
return resolve(execOutput);
|
return resolve(execOutput);
|
||||||
} else {
|
} else {
|
||||||
|
core.error(`Command "git ${command}" exited with code ${exitCode}.`);
|
||||||
return reject(`Command "git ${command}" exited with code ${exitCode}.`);
|
return reject(`Command "git ${command}" exited with code ${exitCode}.`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user