fix(calculate-version): 統一輸出訊息格式
This commit is contained in:
+8
-2
@@ -4,13 +4,19 @@ const https = require('https');
|
|||||||
const { URL } = require('url');
|
const { URL } = require('url');
|
||||||
|
|
||||||
const RELEASES_PER_PAGE = 10;
|
const RELEASES_PER_PAGE = 10;
|
||||||
|
let currentStage = null;
|
||||||
|
|
||||||
function section(title) {
|
function section(title) {
|
||||||
process.stdout.write(`\n==================================================\n${title}\n--------------------------------------------------\n`);
|
currentStage = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
function info(message) {
|
function info(message) {
|
||||||
process.stdout.write(`[info] ${message}\n`);
|
const timestamp = new Date()
|
||||||
|
.toLocaleString('sv-SE', { timeZone: 'Asia/Taipei', hour12: false })
|
||||||
|
.replace(/-/g, '/');
|
||||||
|
const stagePrefix = currentStage ? `[${currentStage}]` : '';
|
||||||
|
|
||||||
|
process.stdout.write(`${stagePrefix}[INF][${timestamp}]: ${message}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fail(message) {
|
function fail(message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user