Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Aug 12, 2022
2 parents 764cddb + 3930d5c commit 3227a1b
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 更新日志

## 2022.08.12 v3.3.3 更新日志

1. 修复`admin`指令合并判断不准确的遗留问题
2. 新增`fetch`公共方法

## 2022.08.12 v3.3.2 更新日志

1. 修复构建流程导致 gitm-ui 无法运行的问题
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/monorepo",
"description": "这是一个git工作流工具",
"version": "3.3.2",
"version": "3.3.3",
"packageManager": "[email protected]",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/core",
"description": "gitmars核心程序",
"version": "3.3.2",
"version": "3.3.3",
"private": false,
"main": "./lib/index.js",
"module": "./lib/index.mjs",
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/git/fetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { spawnSync } from '../spawn'
import { debug } from '../utils/debug'

/**
* 同步远程版本
*/
function fetch(): void {
debug('fetch', 'fetch success')
spawnSync('git', ['fetch'])
}

export default fetch
3 changes: 2 additions & 1 deletion packages/core/src/git/getAheadLogs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { spawnSync } from '../spawn'
import { debug } from '../utils/debug'
import fetch from './fetch'
import getCurrentBranch from './getCurrentBranch'

/**
Expand All @@ -9,7 +10,7 @@ import getCurrentBranch from './getCurrentBranch'
*/
function getAheadLogs(): string[] {
const current = getCurrentBranch()
spawnSync('git', ['fetch'])
fetch()
const { stdout } = spawnSync('git', [
'log',
`origin/${current}..${current}`,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/git/getBehindLogs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { spawnSync } from '../spawn'
import { debug } from '../utils/debug'
import fetch from './fetch'
import getCurrentBranch from './getCurrentBranch'

/**
Expand All @@ -11,7 +12,7 @@ import getCurrentBranch from './getCurrentBranch'
*/
function getBehindLogs(): string[] {
const current = getCurrentBranch()
spawnSync('git', ['fetch'])
fetch()
const { stdout } = spawnSync('git', [
'log',
`${current}..origin/${current}`,
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import getGitStatus from './getGitStatus'
import getCommandMessage from './getCommandMessage'
import checkGitStatus from './checkGitStatus'
import getStashList from './getStashList'
import fetch from './fetch'

export default {
getIsGitProject,
Expand All @@ -40,5 +41,6 @@ export default {
getGitStatus,
getCommandMessage,
checkGitStatus,
getStashList
getStashList,
fetch
}
9 changes: 9 additions & 0 deletions packages/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# 更新日志

## 2022.08.12 v3.3.3 更新日志

1. 修复`admin`指令合并判断不准确的遗留问题
2. 新增`fetch`公共方法

## 2022.08.12 v3.3.2 更新日志

1. 修复构建流程导致 gitm-ui 无法运行的问题

## 2022.08.11 v3.3.1 更新日志

1. 修复`admin`指令合并判断不准确的问题
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/docs",
"description": "gitmars文档库",
"version": "3.3.2",
"version": "3.3.3",
"private": false,
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/gitmars/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gitmars",
"description": "这是一个git工作流工具",
"version": "3.3.2",
"version": "3.3.3",
"private": false,
"bin": {
"gitm": "lib/gitm.js"
Expand Down
2 changes: 2 additions & 0 deletions packages/gitmars/src/gitm-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const getCurrentBranch = require('@gitmars/core/lib/git/getCurrentBranch')
const getGitConfig = require('@gitmars/core/lib/git/getGitConfig')
const getIsMergedTargetBranch = require('@gitmars/core/lib/git/getIsMergedTargetBranch')
const checkGitStatus = require('@gitmars/core/lib/git/checkGitStatus')
const fetch = require('@gitmars/core/lib/git/fetch')
const { createArgs } = require('@gitmars/core/lib/utils/command')
const { spawnSync } = require('@gitmars/core/lib/spawn')
const echo = require('@gitmars/core/lib/utils/echo')
Expand Down Expand Up @@ -141,6 +142,7 @@ publishProgram.action(
const curBranch = await getCurrentBranch()
let isDescriptionCorrect = true // 本次提交的原因描述是否符合规范
if (!status) process.exit(1)
fetch()
// 有配置descriptionValidator时需要校验描述信息
if (config.descriptionValidator) {
// 校验本次提交的原因描述
Expand Down
3 changes: 2 additions & 1 deletion packages/gitmars/src/gitm-cleanbranch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const searchBranches = require('@gitmars/core/lib/git/searchBranches')
const getCurrentBranch = require('@gitmars/core/lib/git/getCurrentBranch')
const getIsMergedTargetBranch = require('@gitmars/core/lib/git/getIsMergedTargetBranch')
const getIsBranchOrCommitExist = require('@gitmars/core/lib/git/getIsBranchOrCommitExist')
const fetch = require('@gitmars/core/lib/git/fetch')
const { createArgs } = require('@gitmars/core/lib/utils/command')
const delay = require('@gitmars/core/lib/utils/delay')
const echo = require('@gitmars/core/lib/utils/echo')
Expand Down Expand Up @@ -111,7 +112,7 @@ program.action(async (branches: string[], opt: GitmBuildOption) => {
const targets = opt.target
? opt.target.split(',')
: [config.develop, config.release]
spawnSync('git', ['fetch'])
fetch()
// 没有传入指定分支,进行查询
if (branches.length === 0) {
branches = searchBranches({
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/server",
"description": "gitmars可视化界面服务端",
"version": "3.3.2",
"version": "3.3.3",
"private": false,
"bin": {
"gitm-server": "./lib/www.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gitmars/ui",
"description": "gitmars可视化界面",
"version": "3.3.2",
"version": "3.3.3",
"private": false,
"bin": {
"gitm-ui": "./index.js"
Expand Down

0 comments on commit 3227a1b

Please sign in to comment.