Skip to content

Commit

Permalink
save on input
Browse files Browse the repository at this point in the history
  • Loading branch information
aexol committed Jul 3, 2024
1 parent 60eb032 commit bc49cee
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
34 changes: 32 additions & 2 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.2",
"version": "0.0.3",
"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
3 changes: 2 additions & 1 deletion packages/config-maker/src/Configuration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class ConfigMaker<
const valueFromCommandLine =
options?.commandLineProvidedOptions?.[k as string];
if (valueFromCommandLine)
returnValue = (decoderFunction?.(valueFromCommandLine) ||
return (decoderFunction?.(valueFromCommandLine) ||
valueFromCommandLine) as ConfigurationOptions[T];

// Then we check if there is environment variable.
Expand Down Expand Up @@ -210,6 +210,7 @@ export class ConfigMaker<
const decoded = decoderFunction?.(answer) || answer;
returnValue = decoded as ConfigurationOptions[T];
}
if (options?.saveOnInput) this.save();
return returnValue;
};

Expand Down
6 changes: 3 additions & 3 deletions packages/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "sandbox",
"private": true,
"version": "0.8.7",
"version": "0.8.8",
"description": "CLI test",
"author": "Artur Czemiel",
"license": "MIT",
"type": "module",
"scripts": {
"cli": "node lib/index.js",
"build":"tspc",
"watch":"tspc --watch"
"build": "tspc",
"watch": "tspc --watch"
},
"dependencies": {
"config-maker": "^0.0.1",
Expand Down

0 comments on commit bc49cee

Please sign in to comment.