Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Dec 15, 2023
1 parent 4faff73 commit 5d8cf45
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,25 @@ function getLocalNwManifest () {
});
}

function getLocalNWVersion () {
return new Promise(async (resolve, reject) => {
const nwManifest = await getLocalNwManifest();
let localNwVersion = nwManifest?.version || '';
localNwVersion = localNwVersion.replace('-sdk', '');
if (localNwVersion) {
resolve(localNwVersion);
} else {
reject(new Error('Unable to get local NW.js version'));
}
});
}

function getCorrectNodeVersion () {
return new Promise(async (resolve, reject) => {
try {
const nwManifest = await getLocalNwManifest();
const localNwVersion = await getLocalNWVersion();
const allNwVersions = await getVersions();

const localNwVersion = nwManifest?.version;
const match = allNwVersions.versions.find(function (version) {
return version.version === 'v' + localNwVersion;
});
Expand Down

0 comments on commit 5d8cf45

Please sign in to comment.