Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Don't warn about hideLogs on some commands #4813

Merged
merged 4 commits into from Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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