Skip to content

Commit 4f76c95

Browse files
committed
Fix fetch-lnd-if-needed.js to work with local TurboLnd tarball
1 parent ad7a4dd commit 4f76c95

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/fetch-lnd-if-needed.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const path = require("path");
33
const { spawnSync } = require("child_process");
44

55
const repoRoot = path.resolve(__dirname, "..");
6+
const packageJson = require(path.join(repoRoot, "package.json"));
67
const turboLndRoot = path.join(repoRoot, "node_modules", "react-native-turbo-lnd");
78
const turboLndPackagePath = path.join(turboLndRoot, "package.json");
89
const turboLndFetchPath = path.join(turboLndRoot, "fetch-lnd.js");
@@ -16,6 +17,14 @@ try {
1617
process.exit(0);
1718
}
1819

20+
const declaredDependency = packageJson.dependencies?.["react-native-turbo-lnd"] ?? "";
21+
if (declaredDependency.startsWith("file:")) {
22+
console.log(
23+
`[postinstall] react-native-turbo-lnd is using a local path (${declaredDependency}); skipping binary fetch.`,
24+
);
25+
process.exit(0);
26+
}
27+
1928
const { version: installedVersion } = JSON.parse(fs.readFileSync(turboLndPackagePath, "utf8"));
2029
if (!installedVersion) {
2130
console.warn(

0 commit comments

Comments
 (0)