@stacksjs/path 0.74.35 → 0.74.37
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 +33 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
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
|
+
|
|
2
32
|
// src/project.ts
|
|
3
33
|
import { relative, resolve } from "path";
|
|
4
34
|
import process from "process";
|
|
@@ -42,34 +72,6 @@ function frameworkPath(path, options) {
|
|
|
42
72
|
}
|
|
43
73
|
|
|
44
74
|
// 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";
|
|
73
75
|
async function debugLog(message) {
|
|
74
76
|
try {
|
|
75
77
|
const loggingPackage = "@stacksjs/" + "logging";
|
|
@@ -357,10 +359,10 @@ async function findProjectPath(project) {
|
|
|
357
359
|
const projects = projectList.split(`
|
|
358
360
|
`).filter((line) => line.startsWith(" - ")).map((line) => line.trim().substring(4));
|
|
359
361
|
await debugLog(`Projects in findProjectPath ${projects}`);
|
|
360
|
-
const
|
|
361
|
-
if (!
|
|
362
|
+
const projectPath = projects.find((proj) => proj.includes(project));
|
|
363
|
+
if (!projectPath)
|
|
362
364
|
throw new Error(`Could not find project with name: ${project}`);
|
|
363
|
-
return
|
|
365
|
+
return projectPath.startsWith("/") ? projectPath : `/${projectPath}`;
|
|
364
366
|
}
|
|
365
367
|
function projectConfigPath(path) {
|
|
366
368
|
return projectPath(`config/${path || ""}`);
|