Skip to content

Commit

Permalink
chore(install): symlink nwjs to nwjs-VERSION-PLATFORM-ARCH dir
Browse files Browse the repository at this point in the history
This allows `nw-builder` to access the downloaded binaries by setting
`cacheDir` to `./node_modules/nw`

Fixes: #128
  • Loading branch information
ayushmanchhabra committed Jan 25, 2024
1 parent bff9036 commit adc6d88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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;
}

0 comments on commit adc6d88

Please sign in to comment.