Skip to content

Commit

Permalink
chore: Make JSv2 Module available on rc and qa branches
Browse files Browse the repository at this point in the history
  • Loading branch information
xLuxy committed Sep 15, 2024
1 parent cd3686e commit ab245ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
39 changes: 20 additions & 19 deletions bin/altv-pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,28 +255,29 @@ async function start() {
}

if (loadJSV2Module) {
if (branch != 'dev') {
console.log(chalk.redBright('===== JS V2 module is only available in dev currently, skipping ====='));
} else {
res = await fetchJsonData(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/update.json`, {
responseType: 'application/json',
headers,
});
for ([file, hash] of Object.entries(res.hashList)) {
linuxFiles[file] = `https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/${file}`;
}
if (branch != 'dev' && branch != 'rc' && !branch.startsWith('qa')) {
console.log(chalk.redBright('===== JSv2 module is currently only available in dev and rc, skipping ====='));
return;
}

res = await fetchJsonData(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/update.json`, {
responseType: 'application/json',
headers,
});
for ([file, hash] of Object.entries(res.hashList)) {
windowsFiles[file] = `https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/${file}`;
}
res = await fetchJsonData(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/update.json`, {
responseType: 'application/json',
headers,
});
for ([file, hash] of Object.entries(res.hashList)) {
linuxFiles[file] = `https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/${file}`;
}

linuxUpdates.push(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/update.json`);
windowsUpdates.push(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/update.json`);
res = await fetchJsonData(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/update.json`, {
responseType: 'application/json',
headers,
});
for ([file, hash] of Object.entries(res.hashList)) {
windowsFiles[file] = `https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/${file}`;
}

linuxUpdates.push(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_linux/update.json`);
windowsUpdates.push(`https://${CDN_ADDRESS}/js-module-v2/${branch}/x64_win32/update.json`);
}

if (loadVoiceServer) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altv-pkg",
"version": "2.7.5",
"version": "2.8.0",
"description": "Install alt:V Binaries Quickly",
"main": "bin/index.js",
"author": "Stuyk & alt:V Team",
Expand Down

0 comments on commit ab245ed

Please sign in to comment.