Skip to content

Commit

Permalink
Add account/config options to individual commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kemmerle committed Nov 22, 2024
1 parent 6298702 commit db6a7e1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
4 changes: 0 additions & 4 deletions commands/hubdb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-nocheck
const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
const createCommand = require('./hubdb/create');
const fetchCommand = require('./hubdb/fetch');
const deleteCommand = require('./hubdb/delete');
Expand All @@ -12,9 +11,6 @@ exports.command = 'hubdb';
exports.describe = i18n(`${i18nKey}.describe`);

exports.builder = yargs => {
addConfigOptions(yargs);
addAccountOptions(yargs);

yargs
.command(clearCommand)
.command(createCommand)
Expand Down
8 changes: 7 additions & 1 deletion commands/hubdb/clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ const {
} = require('../../lib/prompts/selectHubDBTablePrompt');
const { loadAndValidateOptions } = require('../../lib/validation');
const { trackCommandUsage } = require('../../lib/usageTracking');
const { addUseEnvironmentOptions } = require('../../lib/commonOpts');
const {
addConfigOptions,
addAccountOptions,
addUseEnvironmentOptions,
} = require('../../lib/commonOpts');
const { i18n } = require('../../lib/lang');

const i18nKey = 'commands.hubdb.subcommands.clear';
Expand Down Expand Up @@ -65,6 +69,8 @@ exports.handler = async options => {
};

exports.builder = yargs => {
addAccountOptions(yargs);
addConfigOptions(yargs);
addUseEnvironmentOptions(yargs);

yargs.positional('table-id', {
Expand Down
8 changes: 7 additions & 1 deletion commands/hubdb/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ const {
loadAndValidateOptions,
} = require('../../lib/validation');
const { trackCommandUsage } = require('../../lib/usageTracking');
const { addUseEnvironmentOptions } = require('../../lib/commonOpts');
const {
addConfigOptions,
addAccountOptions,
addUseEnvironmentOptions,
} = require('../../lib/commonOpts');
const { i18n } = require('../../lib/lang');

const i18nKey = 'commands.hubdb.subcommands.create';
Expand Down Expand Up @@ -55,6 +59,8 @@ exports.handler = async options => {
};

exports.builder = yargs => {
addAccountOptions(yargs);
addConfigOptions(yargs);
addUseEnvironmentOptions(yargs);

yargs.options('path', {
Expand Down
8 changes: 7 additions & 1 deletion commands/hubdb/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const { logError } = require('../../lib/errorHandlers/index');
const { deleteTable } = require('@hubspot/local-dev-lib/api/hubdb');
const { loadAndValidateOptions } = require('../../lib/validation');
const { trackCommandUsage } = require('../../lib/usageTracking');
const { addUseEnvironmentOptions } = require('../../lib/commonOpts');
const {
addConfigOptions,
addAccountOptions,
addUseEnvironmentOptions,
} = require('../../lib/commonOpts');
const {
selectHubDBTablePrompt,
} = require('../../lib/prompts/selectHubDBTablePrompt');
Expand Down Expand Up @@ -66,6 +70,8 @@ exports.handler = async options => {
};

exports.builder = yargs => {
addAccountOptions(yargs);
addConfigOptions(yargs);
addUseEnvironmentOptions(yargs);

yargs.positional('table-id', {
Expand Down

0 comments on commit db6a7e1

Please sign in to comment.