Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Feb 10, 2024
1 parent 0d5a3d5 commit 618dd0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/supersetbot/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ program
});

const wrap = (f) => {
console.log('WRAP');
const { verbose } = program.opts();
return commands.commandWrapper(f, verbose);
};
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/supersetbot/src/commands.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
export function commandWrapper(commandFunc, verbose = false) {
return async (...args) => {
console.log(`in commandWrapper ${verbose}`);
try {
const resp = await commandFunc(...args); // Use await to ensure the command function is executed properly
if (verbose) {
console.log(resp);
}
} catch (error) {
console.error(`Error during operation: ${error}`);
if (verbose) {
console.error('Error during operation:', error);
} else {
console.error('An error occurred. Use --verbose for more details.');
console.error(error);
}
// Exit with a non-zero status code to indicate failure
process.exit(1);
}
};
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/supersetbot/src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ export function getEnvContext() {
throw new Error('GITHUB_TOKEN is not set. Please set the GITHUB_TOKEN environment variable.');
}
const github = new Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` });
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
return {
source: 'CLI',
github,
context: {
repo: {
repo: 'superset',
owner: 'apache',
repo,
owner,
},
},
};
Expand Down

0 comments on commit 618dd0e

Please sign in to comment.