@cmflow/cli 0.65.2 → 0.65.3
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/package.json
CHANGED
package/src/commands/merge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
3
|
import { mergeBranch } from './tasks/merge-branch'
|
|
4
|
-
import { getConfig } from '../common'
|
|
4
|
+
import { getConfig, git } from '../common'
|
|
5
5
|
|
|
6
6
|
export class Merge {
|
|
7
7
|
mapContext (commander, context) {
|
|
@@ -12,13 +12,22 @@ export class Merge {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
getTasks (context) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { RELEASE_CANDIDATE_TAG } = context
|
|
16
|
+
this.lastCommitMessage = git.getLastCommitMsg()
|
|
17
|
+
if (this.lastCommitMessage.includes(RELEASE_CANDIDATE_TAG)) {
|
|
18
|
+
return [mergeBranch(context)]
|
|
19
|
+
}
|
|
20
|
+
return []
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
success (context) {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
const { RELEASE_CANDIDATE_TAG } = context
|
|
25
|
+
if (this.lastCommitMessage.includes(RELEASE_CANDIDATE_TAG)) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.log(chalk.green(figures.tick), 'Branch', chalk.green(context.BRANCH_NAME), `merged into ${context.PRODUCTION_BRANCH}`)
|
|
28
|
+
} else {
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.log(chalk.green(figures.tick), 'Merge branch', chalk.green(context.BRANCH_NAME), `into ${context.PRODUCTION_BRANCH} not required`)
|
|
31
|
+
}
|
|
23
32
|
}
|
|
24
33
|
}
|
|
@@ -51,14 +51,11 @@ async function gitMep (context) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export function mergeBranch (context) {
|
|
54
|
-
const { BRANCH_NAME,
|
|
54
|
+
const { BRANCH_NAME, PRODUCTION_BRANCH } = context
|
|
55
55
|
return ({
|
|
56
|
-
title: `Merge ${BRANCH_NAME} into ${PRODUCTION_BRANCH}
|
|
56
|
+
title: `Merge ${BRANCH_NAME} into ${PRODUCTION_BRANCH}`,
|
|
57
57
|
task: async () => {
|
|
58
|
-
|
|
59
|
-
if (lastCommitMessage.includes(RELEASE_CANDIDATE_TAG)) {
|
|
60
|
-
await gitMep(context)
|
|
61
|
-
}
|
|
58
|
+
await gitMep(context)
|
|
62
59
|
}
|
|
63
60
|
})
|
|
64
61
|
}
|