@datatruck/cli 0.38.0 → 0.38.1
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.
|
@@ -50,7 +50,7 @@ class GitRepository extends RepositoryAbstract_1.RepositoryAbstract {
|
|
|
50
50
|
log: data.options.verbose,
|
|
51
51
|
});
|
|
52
52
|
if (await git.canBeInit(this.config.repo)) {
|
|
53
|
-
await (0, promises_1.mkdir)(git.options.dir);
|
|
53
|
+
await (0, promises_1.mkdir)(git.options.dir, { recursive: true });
|
|
54
54
|
await git.exec(["init", "--bare", this.config.repo]);
|
|
55
55
|
}
|
|
56
56
|
const branchName = this.config.branch ?? "master";
|
|
@@ -208,7 +208,10 @@ class GitRepository extends RepositoryAbstract_1.RepositoryAbstract {
|
|
|
208
208
|
version: nodePkg.version,
|
|
209
209
|
size: size.toString(),
|
|
210
210
|
});
|
|
211
|
-
await git.addTag(meta.name, meta.message
|
|
211
|
+
await git.addTag(meta.name, meta.message, {
|
|
212
|
+
userName: "datatruck",
|
|
213
|
+
userEmail: "datatruck@localhost",
|
|
214
|
+
});
|
|
212
215
|
await git.push({ branchName });
|
|
213
216
|
await git.pushTags();
|
|
214
217
|
await (0, promises_1.rm)(tmpPath, { recursive: true });
|
|
@@ -53,7 +53,9 @@ function createCommands(globalOptions) {
|
|
|
53
53
|
if (exitCode !== 0)
|
|
54
54
|
throw new Error(`Invalid exit code: ${exitCode}`);
|
|
55
55
|
await end();
|
|
56
|
-
return
|
|
56
|
+
return ["run", "export"].includes(name)
|
|
57
|
+
? undefined
|
|
58
|
+
: JSON.parse(stdoutData);
|
|
57
59
|
}
|
|
58
60
|
finally {
|
|
59
61
|
await end();
|
|
@@ -28,7 +28,7 @@ async function runJob(job, name, config) {
|
|
|
28
28
|
let logPath;
|
|
29
29
|
const dt = new Date().toISOString().replaceAll(":", "-");
|
|
30
30
|
const argv = [
|
|
31
|
-
process.env.pm_exec_path ?? bin,
|
|
31
|
+
process.env.DTT_BIN_SCRIPT ?? process.env.pm_exec_path ?? bin,
|
|
32
32
|
"--tty",
|
|
33
33
|
"false",
|
|
34
34
|
"--progress",
|
package/lib/utils/git.d.ts
CHANGED
|
@@ -37,7 +37,11 @@ export declare class Git {
|
|
|
37
37
|
name: string;
|
|
38
38
|
message?: string | undefined;
|
|
39
39
|
}[]>;
|
|
40
|
-
addTag(name: string, message?: string
|
|
40
|
+
addTag(name: string, message?: string, options?: {
|
|
41
|
+
allowEmpty?: boolean;
|
|
42
|
+
userName?: string;
|
|
43
|
+
userEmail?: string;
|
|
44
|
+
}): Promise<void>;
|
|
41
45
|
pushTags(): Promise<void>;
|
|
42
46
|
push(options: {
|
|
43
47
|
branchName: string;
|
package/lib/utils/git.js
CHANGED
|
@@ -98,12 +98,16 @@ class Git {
|
|
|
98
98
|
return result;
|
|
99
99
|
}, []);
|
|
100
100
|
}
|
|
101
|
-
async addTag(name, message) {
|
|
101
|
+
async addTag(name, message, options = {}) {
|
|
102
|
+
const commit = [
|
|
103
|
+
...(options.userName ? ["-c", `user.name='${options.userName}'`] : []),
|
|
104
|
+
...(options.userEmail ? ["-c", `user.email='${options.userEmail}'`] : []),
|
|
105
|
+
];
|
|
102
106
|
if (message) {
|
|
103
|
-
await this.exec(["tag", "-a", name, "-m", message]);
|
|
107
|
+
await this.exec([...commit, "tag", "-a", name, "-m", message]);
|
|
104
108
|
}
|
|
105
109
|
else {
|
|
106
|
-
await this.exec(["tag", name]);
|
|
110
|
+
await this.exec([...commit, "tag", name]);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
async pushTags() {
|
package/lib/utils/options.js
CHANGED
|
@@ -70,7 +70,7 @@ function stringifyOptions(options, object) {
|
|
|
70
70
|
for (const key in options) {
|
|
71
71
|
const option = options[key];
|
|
72
72
|
const value = object[key];
|
|
73
|
-
if (value
|
|
73
|
+
if (value === undefined)
|
|
74
74
|
continue;
|
|
75
75
|
if (option.flag === false) {
|
|
76
76
|
prepend.push(value);
|