querysub 0.276.0 → 0.278.0
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/package.json
CHANGED
package/src/4-deploy/git.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { runPromise } from "../functional/runCommand";
|
|
|
4
4
|
import { measureWrap } from "socket-function/src/profiling/measure";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import os from "os";
|
|
7
|
+
import path from "path";
|
|
7
8
|
export async function getGitURLLive(gitDir = ".") {
|
|
8
9
|
return (await runPromise(`git remote get-url origin`, { cwd: gitDir })).trim();
|
|
9
10
|
}
|
|
@@ -24,9 +25,22 @@ export async function commitAndPush(config: {
|
|
|
24
25
|
gitDir: string;
|
|
25
26
|
message: string;
|
|
26
27
|
}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// Write commit message to temporary file to handle newlines and special characters properly
|
|
29
|
+
const tempFile = path.join(os.tmpdir(), `commit-message-${Date.now()}-${Math.random().toString(36).substr(2, 9)}.txt`);
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
await fs.promises.writeFile(tempFile, config.message, 'utf8');
|
|
33
|
+
await runPromise(`git add --all`, { cwd: config.gitDir });
|
|
34
|
+
await runPromise(`git commit -F "${tempFile}"`, { cwd: config.gitDir });
|
|
35
|
+
await runPromise(`git push`, { cwd: config.gitDir });
|
|
36
|
+
} finally {
|
|
37
|
+
// Clean up temporary file
|
|
38
|
+
try {
|
|
39
|
+
await fs.promises.unlink(tempFile);
|
|
40
|
+
} catch {
|
|
41
|
+
// Ignore cleanup errors
|
|
42
|
+
}
|
|
43
|
+
}
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
export async function getGitRefInfo(config: {
|
|
@@ -259,9 +259,6 @@ export class MachineServiceControllerBase {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
public async commitPushService(commitMessage: string) {
|
|
262
|
-
|
|
263
|
-
require("debugbreak")(2);
|
|
264
|
-
debugger;
|
|
265
262
|
if (commitMessage.toLowerCase().includes("querysub")) {
|
|
266
263
|
let querysubFolder = path.resolve("../querysub");
|
|
267
264
|
if (fs.existsSync(querysubFolder)) {
|