Skip to content

Commit b0d47a2

Browse files
committed
🐛 fix(cli.ts, github-action.ts, config.ts, prepare-commit-msg-hook.ts): rename OCO_GIT_PUSH to OCO_DISABLE_GIT_PUSH for clarity
The OCO_GIT_PUSH environment variable has been renamed to OCO_DISABLE_GIT_PUSH to better reflect its purpose. The variable now disables git push when set to true. This change has been made in multiple files to ensure consistency across the codebase.
1 parent 616c993 commit b0d47a2

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

out/cli.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17654,9 +17654,9 @@ var configValidators = {
1765417654
);
1765517655
return value;
1765617656
},
17657-
["OCO_GIT_PUSH" /* OCO_GIT_PUSH */](value) {
17657+
["OCO_DISABLE_GIT_PUSH" /* OCO_DISABLE_GIT_PUSH */](value) {
1765817658
validateConfig(
17659-
"OCO_GIT_PUSH" /* OCO_GIT_PUSH */,
17659+
"OCO_DISABLE_GIT_PUSH" /* OCO_DISABLE_GIT_PUSH */,
1766017660
typeof value === "boolean",
1766117661
"Must be true or false"
1766217662
);
@@ -17721,7 +17721,7 @@ var getConfig = () => {
1772117721
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
1772217722
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
1772317723
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
17724-
OCO_GIT_PUSH: process.env.OCO_GITPUSH === "true" ? true : false,
17724+
OCO_DISABLE_GIT_PUSH: process.env.OCO_DISABLE_GITPUSH === "true" ? true : false,
1772517725
OCO_PREFIX: process.env.OCO_PREFIX || ""
1772617726
};
1772717727
const configExists = (0, import_fs.existsSync)(configPath);
@@ -22098,7 +22098,7 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
2209822098
]);
2209922099
ce(`${source_default.green("\u2714")} Successfully committed`);
2210022100
ce(stdout);
22101-
if (config4?.OCO_GIT_PUSH === false)
22101+
if (config4?.OCO_DISABLE_GIT_PUSH === true)
2210222102
return;
2210322103
const remotes = await getGitRemotes();
2210422104
if (!remotes.length) {

out/github-action.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27676,9 +27676,9 @@ var configValidators = {
2767627676
);
2767727677
return value;
2767827678
},
27679-
["OCO_GIT_PUSH" /* OCO_GIT_PUSH */](value) {
27679+
["OCO_DISABLE_GIT_PUSH" /* OCO_DISABLE_GIT_PUSH */](value) {
2768027680
validateConfig(
27681-
"OCO_GIT_PUSH" /* OCO_GIT_PUSH */,
27681+
"OCO_DISABLE_GIT_PUSH" /* OCO_DISABLE_GIT_PUSH */,
2768227682
typeof value === "boolean",
2768327683
"Must be true or false"
2768427684
);
@@ -27743,7 +27743,7 @@ var getConfig = () => {
2774327743
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
2774427744
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
2774527745
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
27746-
OCO_GIT_PUSH: process.env.OCO_GITPUSH === "true" ? true : false,
27746+
OCO_DISABLE_GIT_PUSH: process.env.OCO_DISABLE_GITPUSH === "true" ? true : false,
2774727747
OCO_PREFIX: process.env.OCO_PREFIX || ""
2774827748
};
2774927749
const configExists = (0, import_fs.existsSync)(configPath);

src/commands/commit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ${chalk.grey('——————————————————')}`
6767
outro(stdout);
6868

6969
// user isn't pushing, return early
70-
if(config?.OCO_GIT_PUSH === false) return
70+
if(config?.OCO_DISABLE_GIT_PUSH === true) return
7171

7272
const remotes = await getGitRemotes();
7373

src/commands/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export enum CONFIG_KEYS {
2222
OCO_EMOJI = 'OCO_EMOJI',
2323
OCO_MODEL = 'OCO_MODEL',
2424
OCO_LANGUAGE = 'OCO_LANGUAGE',
25-
OCO_GIT_PUSH = 'OCO_GIT_PUSH',
25+
OCO_DISABLE_GIT_PUSH = 'OCO_DISABLE_GIT_PUSH',
2626
OCO_PREFIX = 'OCO_PREFIX'
2727
}
2828

@@ -102,9 +102,9 @@ export const configValidators = {
102102

103103
return value;
104104
},
105-
[CONFIG_KEYS.OCO_GIT_PUSH](value: any) {
105+
[CONFIG_KEYS.OCO_DISABLE_GIT_PUSH](value: any) {
106106
validateConfig(
107-
CONFIG_KEYS.OCO_GIT_PUSH,
107+
CONFIG_KEYS.OCO_DISABLE_GIT_PUSH,
108108
typeof value === 'boolean',
109109
'Must be true or false'
110110
);
@@ -182,7 +182,7 @@ export const getConfig = (): ConfigType | null => {
182182
OCO_EMOJI: process.env.OCO_EMOJI === 'true' ? true : false,
183183
OCO_MODEL: process.env.OCO_MODEL || 'gpt-3.5-turbo',
184184
OCO_LANGUAGE: process.env.OCO_LANGUAGE || 'en',
185-
OCO_GIT_PUSH: process.env.OCO_GITPUSH === 'true' ? true : false,
185+
OCO_DISABLE_GIT_PUSH: process.env.OCO_DISABLE_GITPUSH === 'true' ? true : false,
186186
OCO_PREFIX: process.env.OCO_PREFIX || '',
187187
};
188188

src/commands/prepare-commit-msg-hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs/promises';
22
import chalk from 'chalk';
33
import { intro, outro, spinner } from '@clack/prompts';
4-
import { getChangedFiles, getDiff, getStagedFiles, gitAdd, getCurrentGitBranch } from '../utils/git';
4+
import { getChangedFiles, getDiff, getStagedFiles, gitAdd } from '../utils/git';
55
import { getConfig } from './config';
66
import { generateCommitMessageByDiff } from '../generateCommitMessageFromGitDiff';
77

0 commit comments

Comments
 (0)