@@ -26984,8 +26984,12 @@ var package_default = {
26984
26984
deploy: "npm version patch && npm run build:push && git push --tags && npm publish --tag latest",
26985
26985
lint: "eslint src --ext ts && tsc --noEmit",
26986
26986
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",
26987
26991
"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"
26989
26993
},
26990
26994
devDependencies: {
26991
26995
"@commitlint/types": "^17.4.4",
@@ -29449,7 +29453,6 @@ function getI18nLocal(value) {
29449
29453
}
29450
29454
29451
29455
// src/commands/config.ts
29452
- dotenv.config();
29453
29456
var MODEL_LIST = {
29454
29457
openai: [
29455
29458
"gpt-3.5-turbo",
@@ -29625,8 +29628,13 @@ var configValidators = {
29625
29628
return value;
29626
29629
}
29627
29630
};
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 });
29630
29638
const configFromEnv = {
29631
29639
OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
29632
29640
OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY,
@@ -29670,7 +29678,7 @@ var getConfig = () => {
29670
29678
}
29671
29679
return config9;
29672
29680
};
29673
- var setConfig = (keyValues) => {
29681
+ var setConfig = (keyValues, configPath = defaultConfigPath ) => {
29674
29682
const config9 = getConfig() || {};
29675
29683
for (const [configKey, configValue] of keyValues) {
29676
29684
if (!configValidators.hasOwnProperty(configKey)) {
0 commit comments