uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,72 @@
|
|||
diff --git a/src/services/log.js b/src/services/log.js
|
||||
index 0fcd9812..dcbff070 100644
|
||||
--- a/src/services/log.js
|
||||
+++ b/src/services/log.js
|
||||
@@ -1,15 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
-const fs = require('fs');
|
||||
-const dataDir = require('./data_dir');
|
||||
const cls = require('./cls');
|
||||
|
||||
-if (!fs.existsSync(dataDir.LOG_DIR)) {
|
||||
- fs.mkdirSync(dataDir.LOG_DIR, 0o700);
|
||||
-}
|
||||
-
|
||||
-let logFile = null;
|
||||
-
|
||||
const SECOND = 1000;
|
||||
const MINUTE = 60 * SECOND;
|
||||
const HOUR = 60 * MINUTE;
|
||||
@@ -17,38 +9,6 @@ const DAY = 24 * HOUR;
|
||||
|
||||
const NEW_LINE = process.platform === "win32" ? '\r\n' : '\n';
|
||||
|
||||
-let todaysMidnight = null;
|
||||
-
|
||||
-initLogFile();
|
||||
-
|
||||
-function getTodaysMidnight() {
|
||||
- const now = new Date();
|
||||
-
|
||||
- return new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
-}
|
||||
-
|
||||
-function initLogFile() {
|
||||
- todaysMidnight = getTodaysMidnight();
|
||||
-
|
||||
- const path = dataDir.LOG_DIR + '/trilium-' + formatDate() + '.log';
|
||||
-
|
||||
- if (logFile) {
|
||||
- logFile.end();
|
||||
- }
|
||||
-
|
||||
- logFile = fs.createWriteStream(path, {flags: 'a'});
|
||||
-}
|
||||
-
|
||||
-function checkDate(millisSinceMidnight) {
|
||||
- if (millisSinceMidnight >= DAY) {
|
||||
- initLogFile();
|
||||
-
|
||||
- millisSinceMidnight -= DAY;
|
||||
- }
|
||||
-
|
||||
- return millisSinceMidnight;
|
||||
-}
|
||||
-
|
||||
function log(str) {
|
||||
const bundleNoteId = cls.get("bundleNoteId");
|
||||
|
||||
@@ -56,12 +16,6 @@ function log(str) {
|
||||
str = `[Script ${bundleNoteId}] ${str}`;
|
||||
}
|
||||
|
||||
- let millisSinceMidnight = Date.now() - todaysMidnight.getTime();
|
||||
-
|
||||
- millisSinceMidnight = checkDate(millisSinceMidnight);
|
||||
-
|
||||
- logFile.write(formatTime(millisSinceMidnight) + ' ' + str + NEW_LINE);
|
||||
-
|
||||
console.log(str);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue