Skip to content

Commit

Permalink
fix(cli): Don't warn about hideLogs on some commands (#4813)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jul 9, 2021
1 parent 95c4756 commit dc279cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions cli/src/config.ts
Expand Up @@ -62,8 +62,6 @@ export async function loadConfig(): Promise<Config> {
},
};

checkExternalConfig(conf);

debug('config: %O', config);

return config;
Expand Down Expand Up @@ -446,7 +444,7 @@ const config: CapacitorConfig = ${formatJSObject(extConfig)};
export default config;\n`;
}

function checkExternalConfig(config: ExtConfigPairs): void {
export function checkExternalConfig(config: ExtConfigPairs): void {
if (
typeof config.extConfig.hideLogs !== 'undefined' ||
typeof config.extConfig.android?.hideLogs !== 'undefined' ||
Expand Down
8 changes: 7 additions & 1 deletion cli/src/index.ts
@@ -1,7 +1,7 @@
import program from 'commander';

import c from './colors';
import { loadConfig } from './config';
import { checkExternalConfig, loadConfig } from './config';
import type { Config } from './definitions';
import { fatal, isFatal } from './errors';
import { receive } from './ipc';
Expand Down Expand Up @@ -86,6 +86,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async (platform, { deployment }) => {
checkExternalConfig(config.app);
const { syncCommand } = await import('./tasks/sync');
await syncCommand(config, platform, deployment);
}),
Expand All @@ -106,6 +107,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async (platform, { deployment }) => {
checkExternalConfig(config.app);
const { updateCommand } = await import('./tasks/update');
await updateCommand(config, platform, deployment);
}),
Expand All @@ -118,6 +120,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async platform => {
checkExternalConfig(config.app);
const { copyCommand } = await import('./tasks/copy');
await copyCommand(config, platform);
}),
Expand Down Expand Up @@ -161,6 +164,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async platform => {
checkExternalConfig(config.app);
const { addCommand } = await import('./tasks/add');
await addCommand(config, platform);
}),
Expand All @@ -173,6 +177,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async platform => {
checkExternalConfig(config.app);
const { listCommand } = await import('./tasks/list');
await listCommand(config, platform);
}),
Expand All @@ -185,6 +190,7 @@ export function runProgram(config: Config): void {
.action(
wrapAction(
telemetryAction(config, async platform => {
checkExternalConfig(config.app);
const { doctorCommand } = await import('./tasks/doctor');
await doctorCommand(config, platform);
}),
Expand Down

0 comments on commit dc279cc

Please sign in to comment.