orbita-downloader 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +37 -0
- package/package.json +19 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import BrowserChecker from 'gologin/src/browser/browser-checker.js';
|
|
2
|
+
|
|
3
|
+
async function main() {
|
|
4
|
+
// Set the GOLOGIN_EXECUTABLE_PATH environment variable as requested
|
|
5
|
+
process.env.GOLOGIN_EXECUTABLE_PATH = '/home/codespace/.gologin/browser/orbita-browser-140/chrome';
|
|
6
|
+
|
|
7
|
+
const bc = new BrowserChecker();
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
console.log('Fetching latest Orbita info...');
|
|
11
|
+
const latestInfo = await bc.getLatestBrowserVersion();
|
|
12
|
+
console.log('Latest info from server:', latestInfo);
|
|
13
|
+
|
|
14
|
+
let latestVersionStr = '';
|
|
15
|
+
if (latestInfo && typeof latestInfo === 'object') {
|
|
16
|
+
latestVersionStr = latestInfo.latestVersion || latestInfo.latest_version || '';
|
|
17
|
+
}
|
|
18
|
+
if (!latestVersionStr && typeof latestInfo === 'string') {
|
|
19
|
+
latestVersionStr = latestInfo;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const major = process.env.ORBITA_MAJOR || (latestVersionStr ? latestVersionStr.split('.')[0] : '137');
|
|
23
|
+
console.log(`Using Orbita major version: ${major}`);
|
|
24
|
+
|
|
25
|
+
console.log('Starting download/install (may take a few minutes)...');
|
|
26
|
+
await bc.checkBrowser({ autoUpdateBrowser: true, majorVersion: major });
|
|
27
|
+
|
|
28
|
+
const exePath = bc.getBrowserExecutablePath(major);
|
|
29
|
+
console.log('Orbita download/installation finished (or already present).');
|
|
30
|
+
console.log('Expected executable path:', exePath);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error('Download failed:', err && err.message ? err.message : err);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "orbita-downloader",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A utility to download and manage Orbita browser for GoLogin.",
|
|
5
|
+
"main": "index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"orbita-download": "./index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["orbita", "gologin", "browser", "download"],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"gologin": "^1.0.0"
|
|
18
|
+
}
|
|
19
|
+
}
|