Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Mar 31, 2020
2 parents f47ecd2 + f890a40 commit 0369529
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/gitm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ program
}
if (opts.includes(type)) {
// release从master拉取,其他从release拉取
let cmd = [`git checkout -b ${config[type]} ${base}`]
let cmd = [`git checkout ${base}`, `git pull`, `git checkout -b ${config[type]} ${base}`]
queue(cmd).then(data => {
if (data[0].code === 0) {
if (data[2].code === 0) {
sh.echo(`${config[type]}分支创建成功,该分支基于${base}创建,您当前已经切换到${name}\n需要发版时,记得执行: ${success('gitm admin publish ' + type)}`)
}
})
Expand Down
6 changes: 3 additions & 3 deletions bin/gitm-start.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const program = require('commander')
const sh = require('shelljs')
const { error, success, config, configFrom, queue, getStatus, pwd } = require('./index')
const { error, success, config, queue, getStatus } = require('./index')
/**
* gitm start
*/
Expand All @@ -17,9 +17,9 @@ program
if (opts.includes(type)) {
// feature从release拉取,bugfix从bug拉取,support从master分支拉取
let base = type === 'bugfix' ? config.bugfix : type === 'support' ? config.master : config.release,
cmd = [`cd ${pwd}`, `git checkout -b ${type}/${name} ${base}`]
cmd = [`git checkout ${base}`, `git pull`, `git checkout -b ${type}/${name} ${base}`]
queue(cmd).then(data => {
if (data[1].code === 0) {
if (data[2].code === 0) {
sh.echo(`${name}分支创建成功,该分支基于${base}创建,您当前已经切换到${type}/${name}\n如果需要提测,请执行${success('gitm combine ' + type + ' ' + name)}\n开发完成后,记得执行: ${success('gitm end ' + type + ' ' + name)}`)
}
})
Expand Down
6 changes: 5 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,14 @@ const postMessage = msg => {
*/
const getMessage = type => {
let str = '',
d = new Date(),
name = pwd.match(/\/([a-zA-Z0-9-_]+)\/?$/)
switch (type) {
case 'time':
str = new Date()
str = d
break
case 'timeNum':
str = d.getTime()
break
case 'pwd':
str = pwd
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gitmars",
"description": "git tool for newbees",
"version": "1.0.11",
"version": "1.0.12",
"main": "bin/gitm.js",
"scripts": {
"start": "react-scripts start"
Expand Down

0 comments on commit 0369529

Please sign in to comment.