-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrustybranch.js
More file actions
35 lines (30 loc) · 1.1 KB
/
rustybranch.js
File metadata and controls
35 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env node
'use strict';
const program = require('commander');
const branchAPI = require('./branchapi');
let appID = '258550'; // Default to Rust Dedicated Server
let branch = 'public'; // Default branch
program
.version('0.3.0')
.usage('[options]')
.option('-s, --server', 'fetch dedicated server buildid (default)')
.option('-c, --client', 'fetch client application buildid')
.option('-b, --branch <name>', 'branch checked', 'public') // Default value set directly
.parse(process.argv);
if (program.server && program.client) {
console.error('Choose either server or client to check buildid, not both.');
program.help(); // Output help and exit
} else {
if (program.client) {
appID = '252490'; // Rust Client Application ID
}
branch = program.branch; // No need to check if program.branch exists due to commander's default
}
(async () => {
try {
const buildID = await branchAPI.getBuildID(appID, branch);
console.log(buildID || 'No build ID found for the specified appID and branch.');
} catch (error) {
console.error(`An error occurred: ${error.message}`);
}
})();