Skip to content

Commit

Permalink
fixed committer
Browse files Browse the repository at this point in the history
  • Loading branch information
aldoyh committed Jul 2, 2023
1 parent 0b2f0b3 commit eabf48c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ out
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*
response.json
29 changes: 22 additions & 7 deletions exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,30 @@ const exec = (cmd, args = [], options = {}) => new Promise((resolve, reject) =>
Object.assign(optionsToCLI, {stdio: ['inherit', 'inherit', 'inherit']});
}
const app = spawn(cmd, args, optionsToCLI);
app.on('close', (code) => {
app.on('close', code => {
if (code !== 0) {
const err = new Error(`Invalid status code: ${code}`);
err.code = code;
return reject(err);
reject(new Error(`Command "${cmd} ${args.join(' ')}" exited with code ${code}`));
return;
}
return resolve(code);
});
app.on('error', reject);
resolve();
}
);

app.on('error', error => {
reject(error);
}
);

app.on('exit', code => {
if (code !== 0) {
reject(new Error(`Command "${cmd} ${args.join(' ')}" exited with code ${code}`));
return;
}
resolve();
}
);


});

module.exports = exec;
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Humanize = require("humanize-plus");
const fs = require("fs");
const exec = require("./exec");

const TODOIST_API_KEY = core.getInput("TODOIST_API_KEY");
const TODOIST_API_KEY = core.getInput("TODOIST_API_KEY") || process.env.TODOIST_API_KEY;
const PREMIUM = core.getInput("PREMIUM");

async function main() {
Expand Down Expand Up @@ -128,4 +128,4 @@ const commitReadme = async () => {

(async () => {
await main();
})();
})();

0 comments on commit eabf48c

Please sign in to comment.