Skip to content

Commit

Permalink
Merge pull request #77 from byulhook/fix/npm-punycode-74
Browse files Browse the repository at this point in the history
fix: dist/setup.mjs 수정  (#74)
  • Loading branch information
love1ace authored Sep 27, 2024
2 parents ab15c28 + e71f0ec commit 6e18901
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions dist/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,27 @@ function writeConfigFile(filePath, defaultConfig) {
}

function readByulHookFile() {
const byulHookFile = path.join(
rootDir,
"node_modules",
"byul",
"dist",
"byul_script"
);
return readFileSync(byulHookFile, "utf8");
const possiblePaths = [
path.join(rootDir, "node_modules", "byul", "dist", "byul_script"),
path.join(
rootDir,
"..",
"..",
"node_modules",
"byul",
"dist",
"byul_script"
),
path.join(rootDir, "byul", "dist", "byul_script"),
];

for (const byulHookFile of possiblePaths) {
if (existsSync(byulHookFile)) {
return readFileSync(byulHookFile, "utf8");
}
}

throw new Error("Unable to find byul_script file.");
}

function setupCommitMsgHook() {
Expand Down

0 comments on commit 6e18901

Please sign in to comment.