zen-gitsync 1.2.1 → 1.2.2
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/README.md +0 -1
- package/package.json +1 -1
- package/src/gitCommit.js +1 -1
- package/src/utils/index.js +9 -5
package/README.md
CHANGED
package/package.json
CHANGED
package/src/gitCommit.js
CHANGED
|
@@ -75,7 +75,7 @@ class GitCommit {
|
|
|
75
75
|
// this.execSyncGitCommand(`git push`);
|
|
76
76
|
this.execGitCommand('git push', {}, (error, stdout, stderr) => {
|
|
77
77
|
console.log('提交完成。')
|
|
78
|
-
this.execSyncGitCommand(`git log -n 1 --pretty=format:"%
|
|
78
|
+
this.execSyncGitCommand(`git log -n 1 --pretty=format:"%B%n%h %d%n%ad" --date=iso`)
|
|
79
79
|
process.exit();
|
|
80
80
|
})
|
|
81
81
|
} catch (e) {
|
package/src/utils/index.js
CHANGED
|
@@ -41,8 +41,10 @@ const coloredLog = (...args) =>{
|
|
|
41
41
|
|
|
42
42
|
// 创建与控制台宽度相同的横线
|
|
43
43
|
// const line = '-'.repeat(terminalWidth);
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
let str = '├─'
|
|
45
|
+
let str2 = '│'
|
|
46
|
+
const start_line = '┌' + '──'.repeat(terminalWidth / 2 - 1) + '┐';
|
|
47
|
+
const end_line = '└' + '──'.repeat(terminalWidth / 2 - 1) + '┘';
|
|
46
48
|
let _args = args.map(arg => arg.split('\n')).flat().filter(arg => arg.trim() !== '');
|
|
47
49
|
console.log(start_line);
|
|
48
50
|
_args.map(async (arg, i) => {
|
|
@@ -75,14 +77,16 @@ const coloredLog = (...args) =>{
|
|
|
75
77
|
fix2 = 2
|
|
76
78
|
}
|
|
77
79
|
fix_end = ' '.repeat(terminalWidth - length - 4 - fix2)
|
|
78
|
-
fix_end += "
|
|
80
|
+
fix_end += "│"
|
|
79
81
|
}
|
|
80
82
|
// console.log(`fix_end ==> `, fix_end)
|
|
81
83
|
if (i === 0) {
|
|
82
|
-
console.log(
|
|
84
|
+
console.log(`│ \x1b[1m\x1b[34m> ${arg}\x1b[22m\x1b[39m${fix_end}`);
|
|
85
|
+
let mid = '├─' + '──'.repeat(terminalWidth / 2 - 2) + '─┤';
|
|
86
|
+
console.log(mid);
|
|
83
87
|
} else {
|
|
84
88
|
if(arg.trim().length > 0) {
|
|
85
|
-
console.log(
|
|
89
|
+
console.log(`│${_color} ${arg}${resetColor()}${fix_end}`);
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
});
|