Skip to content

Commit d94fc99

Browse files
committed
Bugfix in debug log export.
1 parent 4b88577 commit d94fc99

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

XPCService/SCSHXPCService.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ class SCSHXPCService: NSObject, SCSHXPCServiceProtocol {
219219
var temporaryThemeFile: URL? = nil
220220

221221
defer {
222+
if custom_settings.debug {
223+
let log = URL(fileURLWithPath: NSHomeDirectory(), isDirectory: true).appendingPathComponent("Desktop/colorize.log")
224+
225+
// Log the custom theme.
226+
if let url = temporaryThemeFile, let s = try? String(contentsOf: url) {
227+
try? "\n\n#######\n# Custom Theme:\n\(s)\n\n#######".append(to: log)
228+
}
229+
// Log the custom style.
230+
if let url = temporaryCSSFile, let s = try? String(contentsOf: url) {
231+
try? "\n\n#######\n# Custom CSS:\n\(s)\n\n#######".append(to: log)
232+
}
233+
}
234+
222235
if let url = temporaryCSSFile {
223236
do {
224237
// Delete the temporary css.
@@ -415,19 +428,6 @@ class SCSHXPCService: NSObject, SCSHXPCServiceProtocol {
415428

416429
let e = SCSHError.shellError(cmd: cmd, exitCode: result.exitCode, stdOut: result.output() ?? "", stdErr: result.errorOutput() ?? "", message: "QLColorCode: colorize.sh failed with exit code \(result.exitCode). Command was (\(cmd)).")
417430

418-
if custom_settings.debug {
419-
let log = URL(fileURLWithPath: NSHomeDirectory(), isDirectory: true).appendingPathComponent("Desktop/colorize.log")
420-
421-
// Log the custom theme.
422-
if let url = temporaryThemeFile, let s = try? String(contentsOf: url) {
423-
try? "\n\n#######\n# Custom Theme:\n\(s)\n\n#######".append(to: log)
424-
}
425-
// Log the custom style.
426-
if let url = temporaryCSSFile, let s = try? String(contentsOf: url) {
427-
try? "\n\n#######\n# Custom CSS:\n\(s)\n\n#######".append(to: log)
428-
}
429-
}
430-
431431
throw e
432432
} else {
433433
let final_settings = settings.overriding(fromDictionary: [

XPCService/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
box-sizing: border-box;
88
}
99
html, body {
10-
height: 100%
10+
height: 100%;
1111
margin: 0;
1212
padding: 0;
1313
}

0 commit comments

Comments
 (0)