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) + } })