Skip to content

Commit 7469633

Browse files
committed
Merge remote-tracking branch 'origin/master' into dev
2 parents 278e4cb + 0ac7211 commit 7469633

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

out/cli.cjs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26984,8 +26984,12 @@ var package_default = {
2698426984
deploy: "npm version patch && npm run build:push && git push --tags && npm publish --tag latest",
2698526985
lint: "eslint src --ext ts && tsc --noEmit",
2698626986
format: "prettier --write src",
26987+
"test:all": "npm run test:unit:docker && npm run test:e2e:docker",
26988+
"test:docker-build": "docker build -t oco-test -f test/Dockerfile .",
26989+
"test:unit": "NODE_OPTIONS=--experimental-vm-modules jest test/unit",
26990+
"test:unit:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:unit",
2698726991
"test:e2e": "jest test/e2e",
26988-
"test:e2e:docker": "docker build -t oco-e2e -f test/Dockerfile . && DOCKER_CONTENT_TRUST=0 docker run oco-e2e"
26992+
"test:e2e:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:e2e"
2698926993
},
2699026994
devDependencies: {
2699126995
"@commitlint/types": "^17.4.4",
@@ -29449,7 +29453,6 @@ function getI18nLocal(value) {
2944929453
}
2945029454

2945129455
// src/commands/config.ts
29452-
dotenv.config();
2945329456
var MODEL_LIST = {
2945429457
openai: [
2945529458
"gpt-3.5-turbo",
@@ -29625,8 +29628,13 @@ var configValidators = {
2962529628
return value;
2962629629
}
2962729630
};
29628-
var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
29629-
var getConfig = () => {
29631+
var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
29632+
var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env");
29633+
var getConfig = ({
29634+
configPath = defaultConfigPath,
29635+
envPath = defaultEnvPath
29636+
} = {}) => {
29637+
dotenv.config({ path: envPath });
2963029638
const configFromEnv = {
2963129639
OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
2963229640
OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY,
@@ -29670,7 +29678,7 @@ var getConfig = () => {
2967029678
}
2967129679
return config9;
2967229680
};
29673-
var setConfig = (keyValues) => {
29681+
var setConfig = (keyValues, configPath = defaultConfigPath) => {
2967429682
const config9 = getConfig() || {};
2967529683
for (const [configKey, configValue] of keyValues) {
2967629684
if (!configValidators.hasOwnProperty(configKey)) {

out/github-action.cjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48269,7 +48269,6 @@ function getI18nLocal(value) {
4826948269
}
4827048270

4827148271
// src/commands/config.ts
48272-
dotenv.config();
4827348272
var MODEL_LIST = {
4827448273
openai: [
4827548274
"gpt-3.5-turbo",
@@ -48445,8 +48444,13 @@ var configValidators = {
4844548444
return value;
4844648445
}
4844748446
};
48448-
var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
48449-
var getConfig = () => {
48447+
var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
48448+
var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env");
48449+
var getConfig = ({
48450+
configPath = defaultConfigPath,
48451+
envPath = defaultEnvPath
48452+
} = {}) => {
48453+
dotenv.config({ path: envPath });
4845048454
const configFromEnv = {
4845148455
OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
4845248456
OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY,
@@ -48490,7 +48494,7 @@ var getConfig = () => {
4849048494
}
4849148495
return config8;
4849248496
};
48493-
var setConfig = (keyValues) => {
48497+
var setConfig = (keyValues, configPath = defaultConfigPath) => {
4849448498
const config8 = getConfig() || {};
4849548499
for (const [configKey, configValue] of keyValues) {
4849648500
if (!configValidators.hasOwnProperty(configKey)) {

0 commit comments

Comments
 (0)