From 40a45f5c0a91da894d7c46a666b35a92d00c5289 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Wed, 23 Oct 2024 01:46:47 +0300 Subject: [PATCH] fix: add missed bin script extension --- scripts/postinstall.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index cc92be3..e068cfe 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -2,11 +2,14 @@ import { fileURLToPath } from 'node:url' import path from 'node:path' import fs from 'node:fs' -import { binaries } from '../bin/todoctor' +import { binaries } from '../bin/todoctor.js' let filename = fileURLToPath(import.meta.url) let dirname = path.dirname(filename) Object.values(binaries).forEach(binaryPath => { - fs.chmodSync(path.join(dirname, '../bin/', binaryPath), 0o755) + let fullBinaryPath = path.join(dirname, '../bin/', binaryPath) + if (fs.existsSync(fullBinaryPath)) { + fs.chmodSync(path.join(dirname, '../bin/', binaryPath), 0o755) + } })