implement check to verify a run id was provided

This commit is contained in:
worm 2023-01-02 13:32:33 -08:00
parent 606b56c49d
commit df713f4ce9
2 changed files with 10 additions and 4 deletions

0
log Normal file
View file

14
main.js
View file

@ -3,10 +3,16 @@ import { get_run_details } from "./tfc-api-functions.mjs";
const my_config = normalized_config; const my_config = normalized_config;
// console.log(my_config); const runid_provided = run_id => {
return (run_id ? true : false);
}
console.log(process.argv.slice(2)); const runidNotProvided = run_id => {
return !runid_provided(run_id);
}
if(runidNotProvided(process.argv[2])){
throw new Error("RunID must be provided");
}
const response = await get_run_details(my_config.base_url, process.argv.slice(2), my_config.token); const response = await get_run_details(my_config.base_url, process.argv.slice(2), my_config.token);
//console.log(response);