Compare commits

...

6 Commits

Author SHA1 Message Date
di-sukharev
6126fad25c 0.0.16 2023-03-06 21:38:26 +08:00
di-sukharev
01cdd2f58d removed async iife 2023-03-06 21:36:37 +08:00
di-sukharev
acdf464d2e 0.0.15 2023-03-06 21:34:03 +08:00
di-sukharev
3705a66ada 0.0.14 2023-03-06 21:33:06 +08:00
di-sukharev
bdb8da49b7 * 🚀 chore(cli.ts): change file mode from 100644 to 100755
This commit changes the file mode of cli.ts from 100644 to 100755. This change allows the file to be executable.
2023-03-06 21:33:00 +08:00
di-sukharev
6e896ec428 * 🐛 fix(githook.ts): fix HOOK_PATH import path
The import path for HOOK_PATH was incorrect, causing the file to not be found. The path has been updated to correctly reference the cli.cjs file.
2023-03-06 21:07:03 +08:00
4 changed files with 13 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "open-commit",
"version": "0.0.13",
"version": "0.0.16",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-commit",
"version": "0.0.13",
"version": "0.0.16",
"license": "ISC",
"dependencies": {
"@clack/prompts": "^0.6.1",

View File

@@ -1,6 +1,6 @@
{
"name": "opencommit",
"version": "0.0.13",
"version": "0.0.16",
"description": "AI generates conventional commits with mind-blowing accuracy.",
"keywords": [
"git",

0
src/cli.ts Normal file → Executable file
View File

View File

@@ -20,7 +20,7 @@ export const hookCommand = command(
parameters: ['<set/unset>']
},
async (argv) => {
const HOOK_PATH = fileURLToPath(new URL('out/cli.cjs', import.meta.url));
const HOOK_PATH = fileURLToPath(new URL('cli.cjs', import.meta.url));
try {
await assertGitRepo();
@@ -29,8 +29,15 @@ export const hookCommand = command(
if (mode === 'set') {
intro(`setting opencommit as '${HOOK_NAME}' hook`);
if (isHookExists) {
const realPath = await fs.realpath(SYMLINK_URL);
let realPath;
try {
realPath = await fs.realpath(SYMLINK_URL);
} catch (error) {
outro(error as string);
realPath = null;
}
if (realPath === HOOK_PATH)
return outro(`opencommit is already set as '${HOOK_NAME}'`);
@@ -49,6 +56,7 @@ export const hookCommand = command(
if (mode === 'unset') {
intro(`unsetting opencommit as '${HOOK_NAME}' hook`);
if (!isHookExists) {
return outro(
`opencommit wasn't previously set as '${HOOK_NAME}' hook, nothing to remove`