Skip to content

Commit 0369529

Browse files
committed
Merge branch 'dev'
2 parents f47ecd2 + f890a40 commit 0369529

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

bin/gitm-admin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ program
3030
}
3131
if (opts.includes(type)) {
3232
// release从master拉取,其他从release拉取
33-
let cmd = [`git checkout -b ${config[type]} ${base}`]
33+
let cmd = [`git checkout ${base}`, `git pull`, `git checkout -b ${config[type]} ${base}`]
3434
queue(cmd).then(data => {
35-
if (data[0].code === 0) {
35+
if (data[2].code === 0) {
3636
sh.echo(`${config[type]}分支创建成功,该分支基于${base}创建,您当前已经切换到${name}\n需要发版时,记得执行: ${success('gitm admin publish ' + type)}`)
3737
}
3838
})

bin/gitm-start.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
const program = require('commander')
33
const sh = require('shelljs')
4-
const { error, success, config, configFrom, queue, getStatus, pwd } = require('./index')
4+
const { error, success, config, queue, getStatus } = require('./index')
55
/**
66
* gitm start
77
*/
@@ -17,9 +17,9 @@ program
1717
if (opts.includes(type)) {
1818
// feature从release拉取,bugfix从bug拉取,support从master分支拉取
1919
let base = type === 'bugfix' ? config.bugfix : type === 'support' ? config.master : config.release,
20-
cmd = [`cd ${pwd}`, `git checkout -b ${type}/${name} ${base}`]
20+
cmd = [`git checkout ${base}`, `git pull`, `git checkout -b ${type}/${name} ${base}`]
2121
queue(cmd).then(data => {
22-
if (data[1].code === 0) {
22+
if (data[2].code === 0) {
2323
sh.echo(`${name}分支创建成功,该分支基于${base}创建,您当前已经切换到${type}/${name}\n如果需要提测,请执行${success('gitm combine ' + type + ' ' + name)}\n开发完成后,记得执行: ${success('gitm end ' + type + ' ' + name)}`)
2424
}
2525
})

bin/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,14 @@ const postMessage = msg => {
234234
*/
235235
const getMessage = type => {
236236
let str = '',
237+
d = new Date(),
237238
name = pwd.match(/\/([a-zA-Z0-9-_]+)\/?$/)
238239
switch (type) {
239240
case 'time':
240-
str = new Date()
241+
str = d
242+
break
243+
case 'timeNum':
244+
str = d.getTime()
241245
break
242246
case 'pwd':
243247
str = pwd

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gitmars",
33
"description": "git tool for newbees",
4-
"version": "1.0.11",
4+
"version": "1.0.12",
55
"main": "bin/gitm.js",
66
"scripts": {
77
"start": "react-scripts start"

0 commit comments

Comments
 (0)