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 CHANGED
@@ -7,7 +7,6 @@
7
7
 
8
8
  - 一键执行 `git add`、`git commit`、`git push`
9
9
  - 使用交互式命令行输入提交信息
10
- - 提交信息颜色随机显示
11
10
 
12
11
  ## 安装
13
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-gitsync",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "控制台输入g,回车,输入提交内容,自动执行git add+commit+push",
5
5
  "main": "index.js",
6
6
  "type": "module",
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:"%H %d %ad%n%B" --date=iso`)
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) {
@@ -41,8 +41,10 @@ const coloredLog = (...args) =>{
41
41
 
42
42
  // 创建与控制台宽度相同的横线
43
43
  // const line = '-'.repeat(terminalWidth);
44
- const start_line = '' + '——'.repeat(terminalWidth / 2 - 1) + '┐';
45
- const end_line = '' + '——'.repeat(terminalWidth / 2 - 1) + '┘';
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(`| \x1b[1m\x1b[34m> ${arg}\x1b[22m\x1b[39m${fix_end}`);
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(`|${_color} ${arg}${fix_end}`, resetColor());
89
+ console.log(`│${_color} ${arg}${resetColor()}${fix_end}`);
86
90
  }
87
91
  }
88
92
  });