Skip to content

Commit

Permalink
make config clean between various commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Jun 24, 2024
1 parent 2d8e110 commit 9c1f2d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions clients/js/packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const questions: Question[] = params.map(name => ({ name, type: 'text' }));

// Filter questions based on the command
function getQuestionsForCommand(command: string): Question[] {
const commonQuestions = questions.filter(q => q.name !== 'helmFile');
const commonQuestions = questions.filter(q => q.name !== 'config');
if (['start', 'deploy', 'start-ports', 'wait-for-pods'].includes(command)) {
return questions; // Include all questions, including helmFile
return questions; // Include all questions, including config
} else {
return commonQuestions; // Exclude helmFile
return commonQuestions; // Exclude config
}
}

Expand Down
6 changes: 1 addition & 5 deletions clients/js/packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface Config {
}

export const params: string[] = [
'config',
'name',
'version',
'repo',
Expand All @@ -40,14 +41,9 @@ export const params: string[] = [

export const loadConfig = (argv: any): Config => {
console.log("argv: ", argv);
console.log("argv.config: ", argv.config);
let context: StarshipContext = { ...defaultStarshipContext } as StarshipContext;
let starship: StarshipConfig = {} as StarshipConfig;

if (argv.config) {
context.config = argv.config;
}

console.log("context", context);

// Override context with command-line arguments dynamically based on StarshipContext keys
Expand Down

0 comments on commit 9c1f2d4

Please sign in to comment.