@stacksjs/path 0.74.34 → 0.74.35
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/dist/index.js +31 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/index.ts
|
|
3
|
-
import {
|
|
4
|
-
existsSync,
|
|
5
|
-
lstatSync,
|
|
6
|
-
mkdirSync,
|
|
7
|
-
readFileSync,
|
|
8
|
-
readdirSync,
|
|
9
|
-
readlinkSync,
|
|
10
|
-
realpathSync,
|
|
11
|
-
renameSync,
|
|
12
|
-
rmSync,
|
|
13
|
-
unlinkSync
|
|
14
|
-
} from "fs";
|
|
15
|
-
import os from "os";
|
|
16
|
-
import {
|
|
17
|
-
basename,
|
|
18
|
-
delimiter,
|
|
19
|
-
dirname,
|
|
20
|
-
extname,
|
|
21
|
-
isAbsolute,
|
|
22
|
-
join,
|
|
23
|
-
normalize,
|
|
24
|
-
parse,
|
|
25
|
-
relative as relative2,
|
|
26
|
-
resolve as resolve2,
|
|
27
|
-
sep,
|
|
28
|
-
toNamespacedPath
|
|
29
|
-
} from "path";
|
|
30
|
-
import process2 from "process";
|
|
31
|
-
|
|
32
2
|
// src/project.ts
|
|
33
3
|
import { relative, resolve } from "path";
|
|
34
4
|
import process from "process";
|
|
@@ -72,6 +42,34 @@ function frameworkPath(path, options) {
|
|
|
72
42
|
}
|
|
73
43
|
|
|
74
44
|
// src/index.ts
|
|
45
|
+
import {
|
|
46
|
+
existsSync,
|
|
47
|
+
lstatSync,
|
|
48
|
+
mkdirSync,
|
|
49
|
+
readFileSync,
|
|
50
|
+
readdirSync,
|
|
51
|
+
readlinkSync,
|
|
52
|
+
realpathSync,
|
|
53
|
+
renameSync,
|
|
54
|
+
rmSync,
|
|
55
|
+
unlinkSync
|
|
56
|
+
} from "fs";
|
|
57
|
+
import os from "os";
|
|
58
|
+
import {
|
|
59
|
+
basename,
|
|
60
|
+
delimiter,
|
|
61
|
+
dirname,
|
|
62
|
+
extname,
|
|
63
|
+
isAbsolute,
|
|
64
|
+
join,
|
|
65
|
+
normalize,
|
|
66
|
+
parse,
|
|
67
|
+
relative as relative2,
|
|
68
|
+
resolve as resolve2,
|
|
69
|
+
sep,
|
|
70
|
+
toNamespacedPath
|
|
71
|
+
} from "path";
|
|
72
|
+
import process2 from "process";
|
|
75
73
|
async function debugLog(message) {
|
|
76
74
|
try {
|
|
77
75
|
const loggingPackage = "@stacksjs/" + "logging";
|
|
@@ -359,10 +357,10 @@ async function findProjectPath(project) {
|
|
|
359
357
|
const projects = projectList.split(`
|
|
360
358
|
`).filter((line) => line.startsWith(" - ")).map((line) => line.trim().substring(4));
|
|
361
359
|
await debugLog(`Projects in findProjectPath ${projects}`);
|
|
362
|
-
const
|
|
363
|
-
if (!
|
|
360
|
+
const projectPath2 = projects.find((proj) => proj.includes(project));
|
|
361
|
+
if (!projectPath2)
|
|
364
362
|
throw new Error(`Could not find project with name: ${project}`);
|
|
365
|
-
return
|
|
363
|
+
return projectPath2.startsWith("/") ? projectPath2 : `/${projectPath2}`;
|
|
366
364
|
}
|
|
367
365
|
function projectConfigPath(path) {
|
|
368
366
|
return projectPath(`config/${path || ""}`);
|