@just-every/manager 0.1.4 → 0.1.5
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/bin/justevery-manager.js +5 -1
- package/lib/installer.js +4 -2
- package/package.json +1 -1
package/bin/justevery-manager.js
CHANGED
|
@@ -5,7 +5,11 @@ import { platform as osPlatform } from 'os';
|
|
|
5
5
|
const args = process.argv.slice(2);
|
|
6
6
|
const wantsHelp = args.includes('--help') || args.includes('-h');
|
|
7
7
|
const skipLaunchEnv = process.env.JE_AGENT_SKIP_LAUNCH === '1' || process.env.JE_MANAGER_SKIP_LAUNCH === '1';
|
|
8
|
-
const
|
|
8
|
+
const sessionType = (process.env.XDG_SESSION_TYPE || '').toLowerCase();
|
|
9
|
+
const isSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_TTY || process.env.SSH_CLIENT);
|
|
10
|
+
const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
|
|
11
|
+
const hasGuiSession = Boolean(sessionType) && sessionType !== 'tty';
|
|
12
|
+
const isHeadlessLinux = osPlatform() === 'linux' && (!hasDisplay || !hasGuiSession || isSsh);
|
|
9
13
|
const downloadOnly = args.includes('--download-only') || args.includes('--no-open') || skipLaunchEnv || isHeadlessLinux;
|
|
10
14
|
const printPath = args.includes('--print-path');
|
|
11
15
|
|
package/lib/installer.js
CHANGED
|
@@ -322,8 +322,10 @@ function shouldSkipLaunch() {
|
|
|
322
322
|
}
|
|
323
323
|
if (osPlatform() !== 'linux') return false;
|
|
324
324
|
const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
|
|
325
|
-
const
|
|
326
|
-
|
|
325
|
+
const sessionType = (process.env.XDG_SESSION_TYPE || '').toLowerCase();
|
|
326
|
+
const hasGuiSession = Boolean(sessionType) && sessionType !== 'tty';
|
|
327
|
+
const isSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_TTY || process.env.SSH_CLIENT);
|
|
328
|
+
return !hasDisplay || !hasGuiSession || isSsh;
|
|
327
329
|
}
|
|
328
330
|
|
|
329
331
|
export async function resolveAgentVersion() {
|