Skip to content

Commit b345eee

Browse files
committed
build
1 parent cba5993 commit b345eee

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

out/cli.cjs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16272,7 +16272,7 @@ function G3(t, e2) {
1627216272
// package.json
1627316273
var 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");
1768517686
var 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(

out/github-action.cjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26839,7 +26839,7 @@ var configValidators = {
2683926839
}
2684026840
validateConfig(
2684126841
"OCO_OPENAI_MAX_TOKENS" /* OCO_OPENAI_MAX_TOKENS */,
26842-
typeof value === "number",
26842+
value ? typeof value === "number" : void 0,
2684326843
"Must be a number"
2684426844
);
2684526845
return value;
@@ -26870,8 +26870,8 @@ var configValidators = {
2687026870
},
2687126871
["OCO_MODEL" /* OCO_MODEL */](value) {
2687226872
validateConfig(
26873-
"OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */,
26874-
value === "gpt-3.5-turbo" || value === "gpt-4",
26873+
"OCO_MODEL" /* OCO_MODEL */,
26874+
["gpt-3.5-turbo", "gpt-4"].includes(value),
2687526875
`${value} is not supported yet, use 'gpt-4' or 'gpt-3.5-turbo' (default)`
2687626876
);
2687726877
return value;
@@ -26881,19 +26881,23 @@ var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
2688126881
var getConfig = () => {
2688226882
const configFromEnv = {
2688326883
OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
26884-
OCO_OPENAI_MAX_TOKENS: Number(process.env.OCO_OPENAI_MAX_TOKENS),
26884+
OCO_OPENAI_MAX_TOKENS: process.env.OCO_OPENAI_MAX_TOKENS ? Number(process.env.OCO_OPENAI_MAX_TOKENS) : void 0,
2688526885
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
2688626886
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
2688726887
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
26888-
OCO_MODEL: process.env.OCO_MODEL,
26889-
OCO_LANGUAGE: process.env.OCO_LANGUAGE
26888+
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
26889+
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en"
2689026890
};
2689126891
const configExists = (0, import_fs.existsSync)(configPath);
2689226892
if (!configExists)
2689326893
return configFromEnv;
2689426894
const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
2689526895
const config4 = (0, import_ini.parse)(configFile);
2689626896
for (const configKey of Object.keys(config4)) {
26897+
if (!config4[configKey] || ["null", "undefined"].includes(config4[configKey])) {
26898+
config4[configKey] = void 0;
26899+
continue;
26900+
}
2689726901
try {
2689826902
const validator = configValidators[configKey];
2689926903
const validValue = validator(

0 commit comments

Comments
 (0)