Skip to content

Commit

Permalink
save works
Browse files Browse the repository at this point in the history
  • Loading branch information
aexol committed Jul 3, 2024
1 parent c02ca5e commit b9bc0b5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/config-maker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "config-maker",
"version": "0.0.3",
"version": "0.0.4",
"description": "Make interactive config for CLIs. Fetch values from command line, file, user options or environment variable.",
"main": "lib/index.js",
"author": "Artur Czemiel",
Expand Down
4 changes: 2 additions & 2 deletions packages/config-maker/src/Configuration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class ConfigMaker<
if (nameOfEnv) {
const valueFromEnv = getEnvValue(nameOfEnv);
if (valueFromEnv) {
returnValue = (decoderFunction?.(valueFromEnv) ||
return (decoderFunction?.(valueFromEnv) ||
valueFromEnv) as ConfigurationOptions[T];
}
}
Expand Down Expand Up @@ -210,7 +210,7 @@ export class ConfigMaker<
const decoded = decoderFunction?.(answer) || answer;
returnValue = decoded as ConfigurationOptions[T];
}
if (options?.saveOnInput) this.save();
if (options?.saveOnInput && returnValue) this.setValue(k, returnValue);
return returnValue;
};

Expand Down
4 changes: 2 additions & 2 deletions packages/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sandbox",
"private": true,
"version": "0.8.8",
"version": "0.8.9",
"description": "CLI test",
"author": "Artur Czemiel",
"license": "MIT",
Expand All @@ -12,7 +12,7 @@
"watch": "tspc --watch"
},
"dependencies": {
"config-maker": "^0.0.3",
"config-maker": "^0.0.4",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down

0 comments on commit b9bc0b5

Please sign in to comment.