@tedbrain/vlink 0.1.43 → 0.1.45
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/README.md +3 -0
- package/binaries.json +8 -8
- package/installer.js +43 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/binaries.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.45",
|
|
3
3
|
"binaries": {
|
|
4
|
-
"linux-x86_64": "
|
|
5
|
-
"linux-x86_64-glibc2.17": "
|
|
6
|
-
"linux-aarch64": "
|
|
7
|
-
"macos-x86_64": "
|
|
8
|
-
"macos-aarch64": "
|
|
9
|
-
"windows-x86_64.exe": "
|
|
10
|
-
"windows-aarch64.exe": "
|
|
4
|
+
"linux-x86_64": "c11d341004a7b38e213a29c34952873cbf53ccd3a2f8a5b5eeb7f04e85bde773",
|
|
5
|
+
"linux-x86_64-glibc2.17": "fbf50311bf07ddf8088d984947ccab970a99c7851194a65ca60d5392c900c287",
|
|
6
|
+
"linux-aarch64": "30cd433b804a8cbe098110b4d98179a40bba826b1b769b37ac3c5df354cb21cc",
|
|
7
|
+
"macos-x86_64": "625e3a687e275297c933d5be98d26963bf597dfea35a734ee9b906b1bc807a50",
|
|
8
|
+
"macos-aarch64": "16abe65da25b662e816be7a6dbacb41e9ff61ceb376ef90024ec41a5426c3f8a",
|
|
9
|
+
"windows-x86_64.exe": "dc824cb51645779e9ef84e9f729d4ef6acc5f2a16c26ca37d26a0c1c885003ab",
|
|
10
|
+
"windows-aarch64.exe": "f26999f1602318f1e0bce780551f9b5f266504fd41c843c14b26bbf3c3a54809"
|
|
11
11
|
}
|
|
12
12
|
}
|
package/installer.js
CHANGED
|
@@ -318,6 +318,45 @@ function installBinary(sourcePath, targetPath, options = {}) {
|
|
|
318
318
|
return targetPath;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
function windowsCommandShimPath(vlinkPath) {
|
|
322
|
+
return path.join(path.dirname(vlinkPath), 'vlink.cmd');
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function windowsCommandShimContents() {
|
|
326
|
+
return [
|
|
327
|
+
'@echo off',
|
|
328
|
+
'"%~dp0vlink.exe" %*',
|
|
329
|
+
'exit /b %ERRORLEVEL%',
|
|
330
|
+
''
|
|
331
|
+
].join('\r\n');
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function installWindowsCommandShim(vlinkPath, options = {}) {
|
|
335
|
+
const platform = options.platform || process.platform;
|
|
336
|
+
if (platform !== 'win32') return null;
|
|
337
|
+
|
|
338
|
+
const fsImpl = options.fs || fs;
|
|
339
|
+
const output = options.output || process.stderr;
|
|
340
|
+
const commandPath = windowsCommandShimPath(vlinkPath);
|
|
341
|
+
const temporary = `${commandPath}.install-${process.pid}-${Date.now()}`;
|
|
342
|
+
|
|
343
|
+
try {
|
|
344
|
+
fsImpl.writeFileSync(temporary, windowsCommandShimContents(), 'utf8');
|
|
345
|
+
if (fsImpl.existsSync(commandPath)) {
|
|
346
|
+
fsImpl.rmSync(commandPath, { force: true });
|
|
347
|
+
}
|
|
348
|
+
fsImpl.renameSync(temporary, commandPath);
|
|
349
|
+
} catch (error) {
|
|
350
|
+
fsImpl.rmSync(temporary, { force: true });
|
|
351
|
+
throw new VlinkSetupError(
|
|
352
|
+
`failed to install Windows command shim at ${commandPath}: ${error.message}`
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
log(`installed Windows command shim at ${commandPath}`, output);
|
|
357
|
+
return commandPath;
|
|
358
|
+
}
|
|
359
|
+
|
|
321
360
|
function binaryIsStaticElf(binaryPath, options = {}) {
|
|
322
361
|
if ((options.platform || process.platform) !== 'linux') return false;
|
|
323
362
|
const spawnSyncImpl = options.spawnSync || spawnSync;
|
|
@@ -416,6 +455,7 @@ async function runInstaller(options = {}) {
|
|
|
416
455
|
...sharedOptions,
|
|
417
456
|
ensureBinary
|
|
418
457
|
});
|
|
458
|
+
const commandShimPath = installWindowsCommandShim(vlinkPath, sharedOptions);
|
|
419
459
|
|
|
420
460
|
if (skipSetup) {
|
|
421
461
|
log('skipping TedBrain Agent setup', output);
|
|
@@ -428,7 +468,7 @@ async function runInstaller(options = {}) {
|
|
|
428
468
|
if (failure) throw new VlinkSetupError(failure);
|
|
429
469
|
}
|
|
430
470
|
|
|
431
|
-
return { installDir, vlinkPath, setupSkipped: skipSetup };
|
|
471
|
+
return { installDir, vlinkPath, commandShimPath, setupSkipped: skipSetup };
|
|
432
472
|
}
|
|
433
473
|
|
|
434
474
|
function printInstallHelp(output = process.stdout) {
|
|
@@ -471,6 +511,8 @@ module.exports = {
|
|
|
471
511
|
ensureUserPath,
|
|
472
512
|
runVlinkUpdate,
|
|
473
513
|
installBinary,
|
|
514
|
+
windowsCommandShimPath,
|
|
515
|
+
installWindowsCommandShim,
|
|
474
516
|
binaryIsStaticElf,
|
|
475
517
|
runInstaller,
|
|
476
518
|
runInstallerFromArgs,
|
package/package.json
CHANGED