synsci 2.0.2-test.42.1 → 2.0.2-test.44.1
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/synsci.mjs +4 -2
- package/package.json +1 -1
package/bin/synsci.mjs
CHANGED
|
@@ -20,7 +20,7 @@ process.env.__SYNSCI_LAUNCHER_PID = String(process.pid)
|
|
|
20
20
|
import { execFileSync, execSync, spawn } from "node:child_process"
|
|
21
21
|
import { existsSync, readFileSync, realpathSync } from "node:fs"
|
|
22
22
|
import { homedir } from "node:os"
|
|
23
|
-
import { join } from "node:path"
|
|
23
|
+
import { join, resolve } from "node:path"
|
|
24
24
|
import { createInterface } from "node:readline"
|
|
25
25
|
import { fileURLToPath } from "node:url"
|
|
26
26
|
import { npmDistTag, opensciencePackageSpec } from "../lib/channel.mjs"
|
|
@@ -197,8 +197,10 @@ function hasDeprecatedCli() {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function isConnected() {
|
|
200
|
+
const explicit = process.env.OPENSCIENCE_DATA_DIR?.trim()
|
|
200
201
|
const xdgData = process.env.XDG_DATA_HOME || join(homedir(), ".local", "share")
|
|
201
|
-
const
|
|
202
|
+
const data = explicit ? resolve(explicit) : join(xdgData, "openscience")
|
|
203
|
+
const sessionPath = join(data, "openscience-session.json")
|
|
202
204
|
if (!existsSync(sessionPath)) return false
|
|
203
205
|
try {
|
|
204
206
|
const data = JSON.parse(readFileSync(sessionPath, "utf-8"))
|
package/package.json
CHANGED