From adc6d88cc3ed3fcf79d30278f99b7440f8961ead Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:45:32 -0500 Subject: [PATCH] chore(install): symlink `nwjs` to `nwjs-VERSION-PLATFORM-ARCH` dir This allows `nw-builder` to access the downloaded binaries by setting `cacheDir` to `./node_modules/nw` Fixes: #128 --- lib/install.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index 40081b9..dcb3fd2 100755 --- a/lib/install.js +++ b/lib/install.js @@ -1,5 +1,5 @@ const { createWriteStream, existsSync } = require('node:fs'); -const { rename, rm } = require('node:fs/promises'); +const { rename, rm, symlink } = require('node:fs/promises'); const { get } = require('node:https'); const { resolve } = require('node:path'); const { arch, env, platform, exit } = require('node:process'); @@ -219,5 +219,8 @@ async function install() { nwDir ); + // This allows nw-builder to treat ./node_modules/nw as cacheDir and access the downloaded binary. + await symlink(nwDir, nwFile); + return; }