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

Changed warning when using .mirrord config folder to info. closes #29 #87

Merged
merged 16 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,6 @@ export function isTargetSet(verifiedConfig: VerifiedConfig): boolean {
}
}

/**
* Notifies the user we're running with a default config when `resolveMirrordConfig`
* returns `null`.
*/
export function notifyRunningWithDefaultConfig() {
new NotificationBuilder()
.withMessage(`Using default mirrord configuration.`)
.withDisableAction("promptUsingDefaultConfig")
.info();
}

export class MirrordConfigManager {
private static instance?: MirrordConfigManager = undefined;

Expand Down Expand Up @@ -343,6 +332,13 @@ export class MirrordConfigManager {
return null;
}
} else {
// User probably openend vscode in a single file, no folder is loaded and they have
// not set up the `MIRRORD_CONFIG_FILE` env var.
new NotificationBuilder()
.withMessage(`Could not find a config file, using the default mirrord configuration.`)
.withDisableAction("promptUsingDefaultConfig")
.info();

return null;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ async function main(
let target = null;

let configPath = await MirrordConfigManager.getInstance().resolveMirrordConfig(folder, config);
if (configPath === null) { notifyRunningWithDefaultConfig(); }

const verifiedConfig = await mirrordApi.verifyConfig(configPath, config.env);

// If target wasn't specified in the config file (or there's no config file), let user choose pod from dropdown
Expand Down