@acryldev/workspace 0.2.1 → 0.2.2
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/index.js +8 -7
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
2
|
-
import { basename, dirname, isAbsolute, join, normalize, resolve, sep } from "node:path";
|
|
2
|
+
import { basename, dirname, extname, isAbsolute, join, normalize, resolve, sep } from "node:path";
|
|
3
3
|
import { Acryl } from "@acryldev/blends";
|
|
4
4
|
import { INVALID_JSON, jsonBody, ownPage, ownPageSocket, privateApi, readJson } from "@acryldev/loopback-http/router";
|
|
5
5
|
import { chmod, lstat, mkdir, readFile, readdir, realpath, rename, rmdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -2846,12 +2846,13 @@ function workspacePtySpawnDirs(env, platform) {
|
|
|
2846
2846
|
*/
|
|
2847
2847
|
function resolveWorkspacePtyCommand(command, dirs, platform) {
|
|
2848
2848
|
if (isAbsolute(command) || command.includes("/") || command.includes("\\")) return command;
|
|
2849
|
-
const
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
]
|
|
2849
|
+
const runnable = [
|
|
2850
|
+
".exe",
|
|
2851
|
+
".cmd",
|
|
2852
|
+
".bat",
|
|
2853
|
+
".com"
|
|
2854
|
+
];
|
|
2855
|
+
const names = platform !== "win32" ? [command] : runnable.includes(extname(command).toLowerCase()) ? [command] : runnable.map((ext) => `${command}${ext}`);
|
|
2855
2856
|
for (const dir of dirs) for (const name of names) try {
|
|
2856
2857
|
const candidate = join(dir, name);
|
|
2857
2858
|
const stat = statSync(candidate);
|