Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 334d9af

Browse files
authored
Merge pull request #1924 from TriliumNext/feature/signing_issues
Investigate signing issues
2 parents 50157ed + d91fd0f commit 334d9af

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
const child_process = require("child_process");
22
const fs = require("fs");
3-
const { default: path } = require("path");
3+
const path = require("path");
44

55
module.exports = function (filePath) {
66
const { WINDOWS_SIGN_EXECUTABLE } = process.env;
77

8-
const stats = fs.lstatSync(filePath);
9-
console.log(filePath, stats);
10-
118
if (!WINDOWS_SIGN_EXECUTABLE) {
129
console.warn("[Sign] Skip signing due to missing environment variable.");
1310
return;
@@ -19,11 +16,15 @@ module.exports = function (filePath) {
1916
fs.mkdirSync(outputDir);
2017
}
2118

22-
fs.copyFileSync(sourcePath, destPath);
23-
2419
const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`;
25-
console.log(`[Sign] ${command}`);
20+
console.log(`[Sign] Running ${command}`);
21+
22+
try {
23+
child_process.execSync(command);
24+
} catch (e) {
25+
console.warn(`[Sign] Unable to sign ${filePath} due to:\n${e.stdout.toString("utf-8")})}`)
26+
return;
27+
}
2628

27-
const output = child_process.execSync(command);
28-
console.log(`[Sign] ${output}`);
29+
console.log(`[Sign] Signed ${filePath} successfully.`);
2930
}

0 commit comments

Comments
 (0)