whet 0.0.29 → 0.0.30
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/List.d.ts +3 -0
- package/bin/whet/Whet.js +1 -1
- package/bin/whet/stones/Files.js +36 -18
- package/package.json +1 -1
package/bin/List.d.ts
ADDED
package/bin/whet/Whet.js
CHANGED
|
@@ -12,7 +12,7 @@ const $global = Register.$global
|
|
|
12
12
|
export const Whet_Fields_ = Register.global("$hxClasses")["whet._Whet.Whet_Fields_"] =
|
|
13
13
|
class Whet_Fields_ {
|
|
14
14
|
static main() {
|
|
15
|
-
Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.
|
|
15
|
+
Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.29", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info").option("--no-pretty", "disable pretty logging").exitOverride();
|
|
16
16
|
try {
|
|
17
17
|
Whet_Fields_.program.parse();
|
|
18
18
|
}catch (_g) {
|
package/bin/whet/stones/Files.js
CHANGED
|
@@ -19,13 +19,19 @@ class Files extends Register.inherits(Stone) {
|
|
|
19
19
|
let _gthis = this;
|
|
20
20
|
let onDirFile = function (dir, dirFile) {
|
|
21
21
|
let pathId = IdUtils.fromCwdPath(dirFile, RootDir.fromProject(_gthis.project));
|
|
22
|
-
if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
|
|
23
|
-
throw new Error("\"" + dir + "\" is not a directory.");
|
|
24
|
-
};
|
|
25
22
|
let inlobj_id;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (dir == "/") {
|
|
24
|
+
inlobj_id = pathId;
|
|
25
|
+
} else {
|
|
26
|
+
if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
|
|
27
|
+
throw new Error("\"" + dir + "\" is not a directory.");
|
|
28
|
+
};
|
|
29
|
+
let inlobj_id1;
|
|
30
|
+
let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
|
|
31
|
+
inlobj_id1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
|
|
32
|
+
inlobj_id = (inlobj_id1) ? pathId.substring(dir.length) : null;
|
|
33
|
+
};
|
|
34
|
+
return inlobj_id;
|
|
29
35
|
};
|
|
30
36
|
let files = [];
|
|
31
37
|
let dirs = [];
|
|
@@ -51,14 +57,20 @@ class Files extends Register.inherits(Stone) {
|
|
|
51
57
|
generate(hash) {
|
|
52
58
|
let _gthis = this;
|
|
53
59
|
let onDirFile = function (dir, dirFile) {
|
|
60
|
+
let p_id;
|
|
54
61
|
let pathId = IdUtils.fromCwdPath(dirFile, RootDir.fromProject(_gthis.project));
|
|
55
|
-
if (
|
|
56
|
-
|
|
62
|
+
if (dir == "/") {
|
|
63
|
+
p_id = pathId;
|
|
64
|
+
} else {
|
|
65
|
+
if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
|
|
66
|
+
throw new Error("\"" + dir + "\" is not a directory.");
|
|
67
|
+
};
|
|
68
|
+
let p_id1;
|
|
69
|
+
let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
|
|
70
|
+
p_id1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
|
|
71
|
+
p_id = (p_id1) ? pathId.substring(dir.length) : null;
|
|
57
72
|
};
|
|
58
|
-
|
|
59
|
-
let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
|
|
60
|
-
p_id = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
|
|
61
|
-
return SourceData.fromFile((p_id) ? pathId.substring(dir.length) : null, dirFile, pathId);
|
|
73
|
+
return SourceData.fromFile(p_id, dirFile, pathId);
|
|
62
74
|
};
|
|
63
75
|
let files = [];
|
|
64
76
|
let dirs = [];
|
|
@@ -106,13 +118,19 @@ class Files extends Register.inherits(Stone) {
|
|
|
106
118
|
}
|
|
107
119
|
fromCwd(file, dir) {
|
|
108
120
|
let pathId = IdUtils.fromCwdPath(file, RootDir.fromProject(this.project));
|
|
109
|
-
if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
|
|
110
|
-
throw new Error("\"" + dir + "\" is not a directory.");
|
|
111
|
-
};
|
|
112
121
|
let tmp;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
if (dir == "/") {
|
|
123
|
+
tmp = pathId;
|
|
124
|
+
} else {
|
|
125
|
+
if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
|
|
126
|
+
throw new Error("\"" + dir + "\" is not a directory.");
|
|
127
|
+
};
|
|
128
|
+
let tmp1;
|
|
129
|
+
let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
|
|
130
|
+
tmp1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
|
|
131
|
+
tmp = (tmp1) ? pathId.substring(dir.length) : null;
|
|
132
|
+
};
|
|
133
|
+
return {"pathId": pathId, "id": tmp};
|
|
116
134
|
}
|
|
117
135
|
static get __name__() {
|
|
118
136
|
return "whet.stones.Files"
|