mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 07:07:27 +00:00
chore: Enable linting in scripts.
This commit is contained in:
@@ -20,11 +20,17 @@ function runGitCommand(args, options = {}) {
|
||||
}
|
||||
|
||||
function ensureExecutable(targetPath) {
|
||||
if (process.platform === "win32") return;
|
||||
if (!fs.existsSync(targetPath)) return;
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
if (!fs.existsSync(targetPath)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const mode = fs.statSync(targetPath).mode & 0o777;
|
||||
if (mode & 0o100) return;
|
||||
if (mode & 0o100) {
|
||||
return;
|
||||
}
|
||||
fs.chmodSync(targetPath, 0o755);
|
||||
} catch (err) {
|
||||
console.warn(`[setup-git-hooks] chmod failed: ${err}`);
|
||||
@@ -41,7 +47,9 @@ function isGitRepo({ repoRoot = getRepoRoot(), runGit = runGitCommand } = {}) {
|
||||
cwd: repoRoot,
|
||||
stdio: "pipe",
|
||||
});
|
||||
if (result.status !== 0) return false;
|
||||
if (result.status !== 0) {
|
||||
return false;
|
||||
}
|
||||
return String(result.stdout ?? "").trim() === "true";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user