@just-every/manager 0.1.3 → 0.1.4

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 CHANGED
@@ -26,3 +26,4 @@ Use `--download-only` to cache the installer without launching it, and
26
26
  - `JE_AGENT_ASSET` – override the installer filename.
27
27
  - `JE_AGENT_GITHUB_TOKEN` – optional GitHub token for private releases (also supports `GH_TOKEN` / `GITHUB_TOKEN`).
28
28
  - `JE_AGENT_SKIP_DOWNLOAD=1` – skip the postinstall download/caching step.
29
+ - `JE_AGENT_SKIP_LAUNCH=1` – skip launching the installer after download (also supports `JE_MANAGER_SKIP_LAUNCH`).
@@ -1,9 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { ensureInstaller, launchInstaller } from '../lib/installer.js';
3
+ import { platform as osPlatform } from 'os';
3
4
 
4
5
  const args = process.argv.slice(2);
5
6
  const wantsHelp = args.includes('--help') || args.includes('-h');
6
- const downloadOnly = args.includes('--download-only') || args.includes('--no-open');
7
+ const skipLaunchEnv = process.env.JE_AGENT_SKIP_LAUNCH === '1' || process.env.JE_MANAGER_SKIP_LAUNCH === '1';
8
+ const isHeadlessLinux = osPlatform() === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY && !process.env.XDG_SESSION_TYPE;
9
+ const downloadOnly = args.includes('--download-only') || args.includes('--no-open') || skipLaunchEnv || isHeadlessLinux;
7
10
  const printPath = args.includes('--print-path');
8
11
 
9
12
  if (wantsHelp) {
@@ -35,6 +38,8 @@ try {
35
38
  }
36
39
  if (!downloadOnly) {
37
40
  await launchInstaller(result.path);
41
+ } else if (isHeadlessLinux) {
42
+ console.log('No desktop session detected. Run the installer on a machine with a GUI.');
38
43
  }
39
44
  } catch (error) {
40
45
  console.error(`Failed to prepare installer: ${error.message}`);
package/lib/installer.js CHANGED
@@ -316,6 +316,16 @@ function ensureExecutable(path) {
316
316
  } catch {}
317
317
  }
318
318
 
319
+ function shouldSkipLaunch() {
320
+ if (process.env.JE_AGENT_SKIP_LAUNCH === '1' || process.env.JE_MANAGER_SKIP_LAUNCH === '1') {
321
+ return true;
322
+ }
323
+ if (osPlatform() !== 'linux') return false;
324
+ const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
325
+ const hasSession = Boolean(process.env.XDG_SESSION_TYPE);
326
+ return !hasDisplay && !hasSession;
327
+ }
328
+
319
329
  export async function resolveAgentVersion() {
320
330
  if (process.env.JE_AGENT_VERSION) {
321
331
  return process.env.JE_AGENT_VERSION.trim();
@@ -366,6 +376,12 @@ export async function ensureInstaller({ allowDownload = true } = {}) {
366
376
 
367
377
  export function launchInstaller(installerPath) {
368
378
  const platform = osPlatform();
379
+ if (shouldSkipLaunch()) {
380
+ console.log('Every Manager installer downloaded. Launch skipped in this environment.');
381
+ console.log(`Installer path: ${installerPath}`);
382
+ console.log('Run the installer from a desktop session, or pass --download-only to skip launching.');
383
+ return Promise.resolve();
384
+ }
369
385
  if (platform === 'darwin') {
370
386
  return runCommand('open', [installerPath]);
371
387
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@just-every/manager",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Installer wrapper for Every Manager",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",