@@ -16272,7 +16272,7 @@ function G3(t, e2) {
1627216272// package.json
1627316273var package_default = {
1627416274 name: "opencommit",
16275- version: "2.0.16 ",
16275+ version: "2.0.17 ",
1627616276 description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
1627716277 keywords: [
1627816278 "git",
@@ -16315,6 +16315,7 @@ var package_default = {
1631516315 dev: "ts-node ./src/cli.ts",
1631616316 build: "rimraf out && node esbuild.config.js",
1631716317 deploy: "npm run build && npm version patch && npm publish --tag latest",
16318+ "build:push": "npm run build && git add . && git commit -m 'build' && git push",
1631816319 lint: "eslint src --ext ts && tsc --noEmit",
1631916320 format: "prettier --write src"
1632016321 },
@@ -17643,7 +17644,7 @@ var configValidators = {
1764317644 }
1764417645 validateConfig(
1764517646 "OCO_OPENAI_MAX_TOKENS" /* OCO_OPENAI_MAX_TOKENS */,
17646- typeof value === "number",
17647+ value ? typeof value === "number" : void 0 ,
1764717648 "Must be a number"
1764817649 );
1764917650 return value;
@@ -17674,8 +17675,8 @@ var configValidators = {
1767417675 },
1767517676 ["OCO_MODEL" /* OCO_MODEL */](value) {
1767617677 validateConfig(
17677- "OCO_OPENAI_BASE_PATH " /* OCO_OPENAI_BASE_PATH */,
17678- value === "gpt-3.5-turbo" || value === "gpt-4",
17678+ "OCO_MODEL " /* OCO_MODEL */,
17679+ [ "gpt-3.5-turbo", "gpt-4"].includes(value) ,
1767917680 `${value} is not supported yet, use 'gpt-4' or 'gpt-3.5-turbo' (default)`
1768017681 );
1768117682 return value;
@@ -17685,19 +17686,23 @@ var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
1768517686var getConfig = () => {
1768617687 const configFromEnv = {
1768717688 OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
17688- OCO_OPENAI_MAX_TOKENS: Number(process.env.OCO_OPENAI_MAX_TOKENS),
17689+ OCO_OPENAI_MAX_TOKENS: process.env.OCO_OPENAI_MAX_TOKENS ? Number(process.env.OCO_OPENAI_MAX_TOKENS) : void 0 ,
1768917690 OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
1769017691 OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
1769117692 OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
17692- OCO_MODEL: process.env.OCO_MODEL,
17693- OCO_LANGUAGE: process.env.OCO_LANGUAGE
17693+ OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo" ,
17694+ OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en"
1769417695 };
1769517696 const configExists = (0, import_fs.existsSync)(configPath);
1769617697 if (!configExists)
1769717698 return configFromEnv;
1769817699 const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
1769917700 const config4 = (0, import_ini.parse)(configFile);
1770017701 for (const configKey of Object.keys(config4)) {
17702+ if (!config4[configKey] || ["null", "undefined"].includes(config4[configKey])) {
17703+ config4[configKey] = void 0;
17704+ continue;
17705+ }
1770117706 try {
1770217707 const validator = configValidators[configKey];
1770317708 const validValue = validator(
0 commit comments