@tricoteuses/assemblee 2.5.16 → 2.5.18
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/git.d.ts +0 -1
- package/lib/git.js +54 -77
- package/lib/loaders.js +268 -257
- package/package.json +1 -1
- package/lib/file_systems-CzTtoLWb.js +0 -33
package/lib/git.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export declare function resetAndPull(gitDir: string): boolean;
|
|
|
4
4
|
export declare function clone(gitGroupUrl: string | undefined, gitName: string, workingDir: string): void;
|
|
5
5
|
export declare function run(repositoryDir: string, args: string, verbose?: boolean): string;
|
|
6
6
|
export declare function test(repositoryDir: string, args: string, verbose?: boolean): boolean;
|
|
7
|
-
export declare function uidBranchUpdate(repositoryDir: string, subdirectories: any, notHard: boolean): boolean;
|
package/lib/git.js
CHANGED
|
@@ -1,121 +1,98 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function v(e, c) {
|
|
7
|
-
r("git add .", {
|
|
8
|
-
cwd: e,
|
|
1
|
+
import { execSync as i } from "node:child_process";
|
|
2
|
+
const r = 50 * 1024 * 1024;
|
|
3
|
+
function u(t, n) {
|
|
4
|
+
i("git add .", {
|
|
5
|
+
cwd: t,
|
|
9
6
|
env: process.env,
|
|
10
7
|
encoding: "utf-8",
|
|
11
8
|
stdio: ["ignore", "ignore", "pipe"],
|
|
12
|
-
maxBuffer:
|
|
9
|
+
maxBuffer: r
|
|
13
10
|
});
|
|
14
11
|
try {
|
|
15
|
-
return
|
|
16
|
-
cwd:
|
|
12
|
+
return i(`git commit -m "${n}" --quiet`, {
|
|
13
|
+
cwd: t,
|
|
17
14
|
env: process.env,
|
|
18
15
|
encoding: "utf-8",
|
|
19
16
|
stdio: ["ignore", "pipe", "pipe"]
|
|
20
17
|
}), !0;
|
|
21
|
-
} catch (
|
|
22
|
-
if (
|
|
23
|
-
throw console.error(
|
|
18
|
+
} catch (e) {
|
|
19
|
+
if (e.stdout === null || !/nothing to commit/.test(e.stdout))
|
|
20
|
+
throw console.error(e.output), e;
|
|
24
21
|
return !1;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
if (
|
|
30
|
-
for (const
|
|
24
|
+
function f(t, n, e) {
|
|
25
|
+
let o = 0;
|
|
26
|
+
if (u(t, n))
|
|
27
|
+
for (const c of e || [])
|
|
31
28
|
try {
|
|
32
|
-
|
|
33
|
-
cwd:
|
|
29
|
+
i(`git push ${c} master`, {
|
|
30
|
+
cwd: t,
|
|
34
31
|
env: process.env,
|
|
35
32
|
encoding: "utf-8",
|
|
36
33
|
stdio: ["ignore", "ignore", "pipe"]
|
|
37
34
|
});
|
|
38
|
-
} catch (
|
|
39
|
-
console.error(
|
|
35
|
+
} catch (s) {
|
|
36
|
+
console.error(s.output), o = s.status;
|
|
40
37
|
}
|
|
41
38
|
else
|
|
42
|
-
|
|
43
|
-
return
|
|
39
|
+
o = 10;
|
|
40
|
+
return o;
|
|
44
41
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
cwd:
|
|
42
|
+
function g(t) {
|
|
43
|
+
return i("git reset --hard origin/master", {
|
|
44
|
+
cwd: t,
|
|
48
45
|
env: process.env,
|
|
49
46
|
encoding: "utf-8",
|
|
50
47
|
stdio: ["ignore", "ignore", "pipe"]
|
|
51
|
-
}),
|
|
52
|
-
cwd:
|
|
48
|
+
}), i("git pull --rebase", {
|
|
49
|
+
cwd: t,
|
|
53
50
|
env: process.env,
|
|
54
51
|
encoding: "utf-8",
|
|
55
52
|
stdio: ["ignore", "ignore", "pipe"]
|
|
56
53
|
}), !0;
|
|
57
54
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
cwd:
|
|
55
|
+
function p(t, n, e) {
|
|
56
|
+
t !== void 0 && i(`git clone ${t}/${n}.git`, {
|
|
57
|
+
cwd: e,
|
|
61
58
|
env: process.env,
|
|
62
59
|
encoding: "utf-8",
|
|
63
60
|
stdio: ["ignore", "ignore", "pipe"]
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
|
-
function
|
|
63
|
+
function l(t, n, e) {
|
|
67
64
|
try {
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
cwd:
|
|
71
|
-
maxBuffer:
|
|
65
|
+
e && console.log(`git -C ${t} ${n}`);
|
|
66
|
+
const o = i(`git ${n}`, {
|
|
67
|
+
cwd: t,
|
|
68
|
+
maxBuffer: r
|
|
72
69
|
}).toString().trim();
|
|
73
|
-
return
|
|
74
|
-
} catch (
|
|
75
|
-
for (const
|
|
76
|
-
console.error(`${
|
|
77
|
-
throw
|
|
70
|
+
return e && console.log(o), o;
|
|
71
|
+
} catch (o) {
|
|
72
|
+
for (const c of ["stdout", "stderr"])
|
|
73
|
+
console.error(`${c}: ${o[c]}`);
|
|
74
|
+
throw o;
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
|
-
function
|
|
77
|
+
function m(t, n, e) {
|
|
81
78
|
try {
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
cwd:
|
|
79
|
+
e && console.log(`git -C ${t} ${n}`);
|
|
80
|
+
const o = i(`git ${n}`, {
|
|
81
|
+
cwd: t,
|
|
85
82
|
stdio: ["ignore", "pipe", "pipe"],
|
|
86
|
-
maxBuffer:
|
|
83
|
+
maxBuffer: r
|
|
87
84
|
}).toString().trim();
|
|
88
|
-
return
|
|
89
|
-
} catch (
|
|
90
|
-
if (
|
|
91
|
-
throw
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function S(e, c, t) {
|
|
95
|
-
const n = o(e, "rev-parse --abbrev-ref HEAD"), s = "uid", i = process.cwd();
|
|
96
|
-
process.chdir(e);
|
|
97
|
-
for (const f of c) {
|
|
98
|
-
const u = `${f}/uid`;
|
|
99
|
-
l.ensureDirSync(u);
|
|
100
|
-
for (const g of p([`${f}/**/*.json`])) {
|
|
101
|
-
const h = $.basename(g);
|
|
102
|
-
l.renameSync(g, `${u}/${h}`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
process.chdir(i), d(e, `rev-parse remotes/origin/${s}`) ? (o(e, `branch --force ${s} origin/${s}`), o(e, `symbolic-ref HEAD refs/heads/${s}`), o(e, "reset")) : d(e, `rev-parse refs/heads/${s}`) ? (o(e, `symbolic-ref HEAD refs/heads/${s}`), o(e, "reset")) : (o(e, `branch --force ${s} master`), o(e, `symbolic-ref HEAD refs/heads/${s}`), o(e, "reset"), o(e, "rm -r ."));
|
|
106
|
-
for (const f of c) {
|
|
107
|
-
const u = `${f}/uid`;
|
|
108
|
-
o(e, `add ${u}`);
|
|
85
|
+
return e && console.log(o), !0;
|
|
86
|
+
} catch (o) {
|
|
87
|
+
if (o.status != 0) return !1;
|
|
88
|
+
throw o;
|
|
109
89
|
}
|
|
110
|
-
let m = !1;
|
|
111
|
-
return d(e, "diff --quiet --cached") || (o(e, "commit -m 'Update'"), m = !0), o(e, `symbolic-ref HEAD refs/heads/${n}`), o(e, `reset ${t ? "" : "--hard"}`), m;
|
|
112
90
|
}
|
|
113
91
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
S as uidBranchUpdate
|
|
92
|
+
p as clone,
|
|
93
|
+
u as commit,
|
|
94
|
+
f as commitAndPush,
|
|
95
|
+
g as resetAndPull,
|
|
96
|
+
l as run,
|
|
97
|
+
m as test
|
|
121
98
|
};
|