Skip to content

Commit 7aba1c2

Browse files
committed
🔧 (.dockerignore): add node_modules to .dockerignore file to exclude it from Docker build
⬆️ (package.json): upgrade version from 3.2.2 to 3.2.3 in package.json ♻️ (httpAgent.ts): refactor code in getHttpAgent function to improve readability and maintainability
1 parent 3154b85 commit 7aba1c2

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.env
2+
node_modules

out/cli.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39543,8 +39543,6 @@ function getHttpAgent(url_) {
3954339543
}
3954439544
const ca = Array.from(/* @__PURE__ */ new Set([...import_node_tls.default.rootCertificates, ...globalCerts]));
3954539545
const customCerts = config7.OCO_HTTP_CA_BUNDLE;
39546-
console.error(customCerts);
39547-
console.error("AAAA");
3954839546
if (isDefinedAndNotEmpty(customCerts)) {
3954939547
ca.push(
3955039548
...customCerts.split(",").map((customCert) => fs2.readFileSync(customCert, "utf8"))
@@ -39559,7 +39557,6 @@ function getHttpAgent(url_) {
3955939557
keepAlive: true,
3956039558
keepAliveMsecs: timeout
3956139559
};
39562-
console.log(config7);
3956339560
if (isDefinedAndNotEmpty(config7.OCO_HTTP_CLIENT_CERTIFICATE_CERT) && isDefinedAndNotEmpty(config7.OCO_HTTP_CLIENT_CERTIFICATE_KEY)) {
3956439561
agentOptions.cert = fs2.readFileSync(
3956539562
config7.OCO_HTTP_CLIENT_CERTIFICATE_CERT,

out/github-action.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58341,8 +58341,6 @@ function getHttpAgent(url_) {
5834158341
}
5834258342
const ca = Array.from(/* @__PURE__ */ new Set([...import_node_tls.default.rootCertificates, ...globalCerts]));
5834358343
const customCerts = config6.OCO_HTTP_CA_BUNDLE;
58344-
console.error(customCerts);
58345-
console.error("AAAA");
5834658344
if (isDefinedAndNotEmpty(customCerts)) {
5834758345
ca.push(
5834858346
...customCerts.split(",").map((customCert) => fs2.readFileSync(customCert, "utf8"))
@@ -58357,7 +58355,6 @@ function getHttpAgent(url_) {
5835758355
keepAlive: true,
5835858356
keepAliveMsecs: timeout
5835958357
};
58360-
console.log(config6);
5836158358
if (isDefinedAndNotEmpty(config6.OCO_HTTP_CLIENT_CERTIFICATE_CERT) && isDefinedAndNotEmpty(config6.OCO_HTTP_CLIENT_CERTIFICATE_KEY)) {
5836258359
agentOptions.cert = fs2.readFileSync(
5836358360
config6.OCO_HTTP_CLIENT_CERTIFICATE_CERT,

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencommit",
3-
"version": "3.2.2",
3+
"version": "3.2.3",
44
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
55
"keywords": [
66
"git",

src/utils/httpAgent.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export function getHttpAgent(url_: URL | string): Agent {
3636
const customCerts = config.OCO_HTTP_CA_BUNDLE;
3737
if (isDefinedAndNotEmpty(customCerts)) {
3838
ca.push(
39-
...customCerts.split(",").map((customCert) => fs.readFileSync(customCert, 'utf8'))
39+
...customCerts
40+
.split(',')
41+
.map((customCert) => fs.readFileSync(customCert, 'utf8'))
4042
);
4143
}
4244

@@ -73,12 +75,11 @@ export function getHttpAgent(url_: URL | string): Agent {
7375
const proxy = config.OCO_HTTP_PROXY;
7476
// Create agent
7577
const protocol = url.protocol === 'https:' ? https : http;
76-
const agent =
77-
isDefinedAndNotEmpty(proxy)
78-
? protocol === https
79-
? new HttpsProxyAgent(proxy, agentOptions)
80-
: new HttpProxyAgent(proxy, agentOptions)
81-
: new protocol.Agent(agentOptions);
78+
const agent = isDefinedAndNotEmpty(proxy)
79+
? protocol === https
80+
? new HttpsProxyAgent(proxy, agentOptions)
81+
: new HttpProxyAgent(proxy, agentOptions)
82+
: new protocol.Agent(agentOptions);
8283

8384
return agent;
8485
}

0 commit comments

Comments
 (0)