@linxin666/dsh-client-ui-plugin-manager 0.3.3 → 0.3.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/lib/client.js +1 -1
- package/lib/index.js +8 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { copyFile, readFile, rename, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { isAbsolute, join, posix, win32 } from "node:path";
|
|
5
5
|
import { isMap, isScalar, isSeq, parseDocument } from "yaml";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
+
import { isAbsolute as isAbsolute$1, join as join$1 } from "node:path/posix";
|
|
7
8
|
//#region src/mount-once.ts
|
|
8
9
|
/**
|
|
9
10
|
* Host single-instance guard shared by the plugin family. The family bundle
|
|
@@ -383,8 +384,9 @@ async function duplicateMountBundles(facts, before, beforeBundles, afterBundles)
|
|
|
383
384
|
*/
|
|
384
385
|
/** Expand a leading ~ (or ~user) in a path, platform-style. */
|
|
385
386
|
function expandHome(path, home = homedir()) {
|
|
387
|
+
const j = home.startsWith("/") ? join$1 : join;
|
|
386
388
|
if (path === "~") return home;
|
|
387
|
-
if (path.startsWith("~/") || path.startsWith("~\\")) return
|
|
389
|
+
if (path.startsWith("~/") || path.startsWith("~\\")) return j(home, path.slice(2));
|
|
388
390
|
return path;
|
|
389
391
|
}
|
|
390
392
|
/**
|
|
@@ -394,12 +396,15 @@ function expandHome(path, home = homedir()) {
|
|
|
394
396
|
* @returns the absolute DSH home path.
|
|
395
397
|
*/
|
|
396
398
|
function resolveDshHome(env = process.env, home = homedir()) {
|
|
399
|
+
const isPosix = home.startsWith("/");
|
|
400
|
+
const j = isPosix ? join$1 : join;
|
|
401
|
+
const isAbs = isPosix ? isAbsolute$1 : isAbsolute;
|
|
397
402
|
const raw = env.DSH_HOME;
|
|
398
403
|
if (raw !== void 0 && raw.trim() !== "") {
|
|
399
404
|
const expanded = expandHome(raw.trim(), home);
|
|
400
|
-
return
|
|
405
|
+
return isAbs(expanded) ? expanded : j(process.cwd(), expanded);
|
|
401
406
|
}
|
|
402
|
-
return
|
|
407
|
+
return j(home, ".dsh");
|
|
403
408
|
}
|
|
404
409
|
//#endregion
|
|
405
410
|
//#region src/host/profile.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-plugin-manager",
|
|
3
3
|
"description": "Plugin manager tab for the dsh web GUI Plugins settings section: installs plugins from npm or git through the official host channels, lists installed plugins with next-start enablement switches, surfaces install-time conflict actions with undo, and hands failures off to repair conversations.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|