1 | 'use strict';
|
2 | const Listr = require('listr');
|
3 | const git = require('./git-util');
|
4 |
|
5 | module.exports = options => {
|
6 | const tasks = [
|
7 | {
|
8 | title: 'Check current branch',
|
9 | task: () => git.verifyCurrentBranchIsMaster()
|
10 | },
|
11 | {
|
12 | title: 'Check local working tree',
|
13 | task: () => git.verifyWorkingTreeIsClean()
|
14 | },
|
15 | {
|
16 | title: 'Check remote history',
|
17 | task: () => git.verifyRemoteHistoryIsClean()
|
18 | }
|
19 | ];
|
20 |
|
21 | if (options.anyBranch) {
|
22 | tasks.shift();
|
23 | }
|
24 |
|
25 | return new Listr(tasks);
|
26 | };
|