release-it 18.1.1 → 19.0.0-next.0

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.
@@ -2,14 +2,13 @@ import { EOL } from 'node:os';
2
2
  import _ from 'lodash';
3
3
  import { execa } from 'execa';
4
4
  import matcher from 'wildcard-match';
5
- import { format, e } from '../../util.js';
5
+ import { format, e, fixArgs } from '../../util.js';
6
6
  import GitBase from '../GitBase.js';
7
7
  import prompts from './prompts.js';
8
8
 
9
9
  const noop = Promise.resolve();
10
10
  const invalidPushRepoRe = /^\S+@/;
11
11
  const options = { write: false };
12
- const fixArgs = args => (args ? (typeof args === 'string' ? args.split(' ') : args) : []);
13
12
 
14
13
  const docs = 'https://git.io/release-it-git';
15
14
 
@@ -1,4 +1,4 @@
1
- import fs from 'node:fs';
1
+ import { createReadStream, statSync } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import open from 'open';
4
4
  import { Octokit } from '@octokit/rest';
@@ -301,13 +301,13 @@ class GitHub extends Release {
301
301
  const url = this.getContext('upload_url');
302
302
  const name = path.basename(filePath);
303
303
  const contentType = mime.contentType(name) || 'application/octet-stream';
304
- const contentLength = fs.statSync(filePath).size;
304
+ const contentLength = statSync(filePath).size;
305
305
 
306
306
  return this.retry(async bail => {
307
307
  try {
308
308
  const options = {
309
309
  url,
310
- data: fs.createReadStream(filePath),
310
+ data: createReadStream(filePath),
311
311
  name,
312
312
  headers: {
313
313
  'content-type': contentType,
@@ -1,5 +1,5 @@
1
- import fs from 'node:fs';
2
1
  import path from 'node:path';
2
+ import fs, { promises } from 'node:fs'; // import fs here so it can be stubbed in tests
3
3
  import { globby } from 'globby';
4
4
  import _ from 'lodash';
5
5
  import { Agent } from 'undici';
@@ -268,7 +268,7 @@ class GitLab extends Release {
268
268
  if (useGenericPackageRepositoryForAssets) {
269
269
  const options = {
270
270
  method: 'PUT',
271
- body: await fs.promises.readFile(filePath)
271
+ body: await promises.readFile(filePath)
272
272
  };
273
273
  try {
274
274
  const body = await this.request(endpoint, options);
@@ -286,7 +286,7 @@ class GitLab extends Release {
286
286
  }
287
287
  } else {
288
288
  const body = new FormData();
289
- const rawData = await fs.promises.readFile(filePath);
289
+ const rawData = await promises.readFile(filePath);
290
290
  body.set('file', new Blob([rawData]), name);
291
291
  const options = { body };
292
292
 
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import semver from 'semver';
3
3
  import urlJoin from 'url-join';
4
4
  import Plugin from '../Plugin.js';
5
- import { hasAccess, rejectAfter, parseVersion, readJSON, e } from '../../util.js';
5
+ import { hasAccess, rejectAfter, parseVersion, readJSON, e, fixArgs } from '../../util.js';
6
6
  import prompts from './prompts.js';
7
7
 
8
8
  const docs = 'https://git.io/release-it-npm';
@@ -15,8 +15,6 @@ const DEFAULT_TAG_PRERELEASE = 'next';
15
15
  const NPM_BASE_URL = 'https://www.npmjs.com';
16
16
  const NPM_PUBLIC_PATH = '/package';
17
17
 
18
- const fixArgs = args => (args ? (typeof args === 'string' ? args.split(' ') : args) : []);
19
-
20
18
  class npm extends Plugin {
21
19
  static isEnabled(options) {
22
20
  return hasAccess(MANIFEST_PATH) && options !== false;
package/lib/shell.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import util from 'node:util';
2
- import sh from 'shelljs';
2
+ import childProcess from 'node:child_process';
3
3
  import { execa } from 'execa';
4
4
  import { format } from './util.js';
5
5
 
6
6
  const debug = util.debug('release-it:shell');
7
7
 
8
- sh.config.silent = !debug.enabled;
9
-
10
8
  const noop = Promise.resolve();
11
9
 
12
10
  class Shell {
@@ -55,8 +53,9 @@ class Shell {
55
53
 
56
54
  execStringCommand(command, options, { isExternal }) {
57
55
  return new Promise((resolve, reject) => {
58
- const childProcess = sh.exec(command, { async: true }, (code, stdout, stderr) => {
56
+ const proc = childProcess.exec(command, (err, stdout, stderr) => {
59
57
  stdout = stdout.toString().trimEnd();
58
+ const code = !err ? 0 : err === 'undefined' ? 1 : err.code;
60
59
  debug({ command, options, code, stdout, stderr });
61
60
  if (code === 0) {
62
61
  resolve(stdout);
@@ -64,8 +63,8 @@ class Shell {
64
63
  reject(new Error(stderr || stdout));
65
64
  }
66
65
  });
67
- childProcess.stdout.on('data', stdout => this.log.verbose(stdout.toString().trimEnd(), { isExternal }));
68
- childProcess.stderr.on('data', stderr => this.log.verbose(stderr.toString().trimEnd(), { isExternal }));
66
+ proc.stdout.on('data', stdout => this.log.verbose(stdout.toString().trimEnd(), { isExternal }));
67
+ proc.stderr.on('data', stderr => this.log.verbose(stderr.toString().trimEnd(), { isExternal }));
69
68
  });
70
69
  }
71
70
 
package/lib/util.js CHANGED
@@ -1,4 +1,5 @@
1
- import fs from 'node:fs';
1
+ import fs, { close, openSync, statSync, utimesSync, accessSync } from 'node:fs'; // need import fs here due to test stubbing
2
+ import util from 'node:util';
2
3
  import { EOL } from 'node:os';
3
4
  import _ from 'lodash';
4
5
  import gitUrlParse from 'git-url-parse';
@@ -6,6 +7,12 @@ import semver from 'semver';
6
7
  import osName from 'os-name';
7
8
  import Log from './log.js';
8
9
 
10
+ export const execOpts = {
11
+ stdio: process.env.NODE_DEBUG && process.env.NODE_DEBUG.indexOf('release-it') === 0 ? 'pipe' : []
12
+ };
13
+
14
+ const debug = util.debug('release-it:shell');
15
+
9
16
  const readJSON = file => JSON.parse(fs.readFileSync(file, 'utf8'));
10
17
 
11
18
  const pkg = readJSON(new URL('../package.json', import.meta.url));
@@ -68,7 +75,7 @@ const reduceUntil = async (collection, fn) => {
68
75
 
69
76
  const hasAccess = path => {
70
77
  try {
71
- fs.accessSync(path);
78
+ accessSync(path);
72
79
  return true;
73
80
  } catch (err) {
74
81
  return false;
@@ -96,6 +103,35 @@ const e = (message, docs, fail = true) => {
96
103
  return error;
97
104
  };
98
105
 
106
+ const touch = (path, callback) => {
107
+ const stat = tryStatFile(path);
108
+ if (stat && stat.isDirectory()) {
109
+ // don't error just exit
110
+ return;
111
+ }
112
+
113
+ const fd = openSync(path, 'a');
114
+ close(fd);
115
+ const now = new Date();
116
+ const mtime = now;
117
+ const atime = now;
118
+ utimesSync(path, atime, mtime);
119
+ if (callback) {
120
+ callback();
121
+ }
122
+ };
123
+
124
+ const tryStatFile = filePath => {
125
+ try {
126
+ return statSync(filePath);
127
+ } catch (e) {
128
+ debug(e);
129
+ return null;
130
+ }
131
+ };
132
+
133
+ const fixArgs = args => (args ? (typeof args === 'string' ? args.split(' ') : args) : []);
134
+
99
135
  export {
100
136
  getSystemInfo,
101
137
  format,
@@ -106,5 +142,7 @@ export {
106
142
  hasAccess,
107
143
  parseVersion,
108
144
  readJSON,
109
- e
145
+ fixArgs,
146
+ e,
147
+ touch
110
148
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "18.1.1",
3
+ "version": "19.0.0-next.0",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing-related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -69,7 +69,7 @@
69
69
  "lint": "eslint lib test",
70
70
  "format": "prettier --write eslint.config.mjs \"{lib,test}/**/*.js\"",
71
71
  "docs": "remark README.md 'docs/**/*.md' '.github/*.md' -o",
72
- "test": "ava --no-worker-threads && installed-check --ignore ava",
72
+ "test": "ava --no-worker-threads && installed-check --ignore ava --ignore nock",
73
73
  "release": "./bin/release-it.js"
74
74
  },
75
75
  "author": {
@@ -79,56 +79,55 @@
79
79
  "license": "MIT",
80
80
  "dependencies": {
81
81
  "@iarna/toml": "2.2.5",
82
- "@octokit/rest": "21.0.2",
82
+ "@octokit/rest": "21.1.0",
83
83
  "async-retry": "1.3.3",
84
84
  "chalk": "5.4.1",
85
85
  "ci-info": "^4.1.0",
86
86
  "cosmiconfig": "9.0.0",
87
87
  "execa": "9.5.2",
88
88
  "git-url-parse": "16.0.0",
89
- "globby": "14.0.2",
90
- "inquirer": "12.3.0",
89
+ "globby": "14.1.0",
90
+ "inquirer": "12.4.1",
91
91
  "issue-parser": "7.0.1",
92
92
  "lodash": "4.17.21",
93
93
  "mime-types": "2.1.35",
94
94
  "new-github-release-url": "2.0.0",
95
95
  "open": "10.1.0",
96
- "ora": "8.1.1",
96
+ "ora": "8.2.0",
97
97
  "os-name": "6.0.0",
98
98
  "proxy-agent": "6.5.0",
99
- "semver": "7.6.3",
100
- "shelljs": "0.8.5",
101
- "undici": "6.21.0",
99
+ "semver": "7.7.1",
100
+ "undici": "6.21.1",
102
101
  "update-notifier": "7.3.1",
103
102
  "url-join": "5.0.0",
104
103
  "wildcard-match": "5.1.4",
105
104
  "yargs-parser": "21.1.1"
106
105
  },
107
106
  "devDependencies": {
108
- "@eslint/compat": "1.2.4",
107
+ "@eslint/compat": "1.2.6",
109
108
  "@eslint/eslintrc": "3.2.0",
110
- "@eslint/js": "9.17.0",
109
+ "@eslint/js": "9.20.0",
111
110
  "@octokit/request-error": "6.1.6",
112
- "@types/node": "20.17.11",
111
+ "@types/node": "20.17.17",
113
112
  "ava": "6.2.0",
114
- "eslint": "9.17.0",
115
- "eslint-config-prettier": "9.1.0",
113
+ "eslint": "9.20.1",
114
+ "eslint-config-prettier": "10.0.1",
116
115
  "eslint-plugin-ava": "15.0.1",
117
116
  "eslint-plugin-import-x": "4.6.1",
118
- "eslint-plugin-prettier": "5.2.1",
117
+ "eslint-plugin-prettier": "5.2.3",
119
118
  "fs-monkey": "1.0.6",
120
119
  "globals": "15.14.0",
121
120
  "installed-check": "9.3.0",
122
- "knip": "5.41.1",
123
- "memfs": "4.15.3",
121
+ "knip": "5.44.0",
122
+ "memfs": "4.17.0",
124
123
  "mock-stdio": "1.0.3",
125
- "nock": "14.0.0-beta.8",
126
- "prettier": "3.4.2",
124
+ "nock": "14.0.1",
125
+ "prettier": "3.5.0",
127
126
  "remark-cli": "12.0.1",
128
127
  "remark-preset-webpro": "1.1.1",
129
128
  "sinon": "19.0.2",
130
129
  "strip-ansi": "7.1.0",
131
- "typescript": "5.7.2"
130
+ "typescript": "5.7.3"
132
131
  },
133
132
  "overrides": {
134
133
  "pac-resolver": "7.0.1",
package/test/git.init.js CHANGED
@@ -1,8 +1,10 @@
1
+ import childProcess from 'node:child_process';
2
+ import { mkdirSync } from 'node:fs';
1
3
  import test from 'ava';
2
- import sh from 'shelljs';
3
4
  import Shell from '../lib/shell.js';
4
5
  import Git from '../lib/plugin/git/Git.js';
5
- import { readJSON } from '../lib/util.js';
6
+ import { execOpts, readJSON } from '../lib/util.js';
7
+ import sh from './util/sh.js';
6
8
  import { factory } from './util/index.js';
7
9
  import { mkTmpDir, gitAdd } from './util/helpers.js';
8
10
 
@@ -11,10 +13,10 @@ const { git } = readJSON(new URL('../config/release-it.json', import.meta.url));
11
13
  test.serial.beforeEach(t => {
12
14
  const bare = mkTmpDir();
13
15
  const target = mkTmpDir();
14
- sh.pushd('-q', bare);
15
- sh.exec(`git init --bare .`);
16
- sh.exec(`git clone ${bare} ${target}`);
17
- sh.pushd('-q', target);
16
+ process.chdir(bare);
17
+ sh.exec(`git init --bare .`, execOpts);
18
+ sh.exec(`git clone ${bare} ${target}`, execOpts);
19
+ process.chdir(target);
18
20
  gitAdd('line', 'file', 'Add file');
19
21
  t.context = { bare, target };
20
22
  });
@@ -22,14 +24,14 @@ test.serial.beforeEach(t => {
22
24
  test.serial('should throw if on wrong branch', async t => {
23
25
  const options = { git: { requireBranch: 'dev' } };
24
26
  const gitClient = factory(Git, { options });
25
- sh.exec('git remote remove origin');
27
+ childProcess.execSync('git remote remove origin', execOpts);
26
28
  await t.throwsAsync(gitClient.init(), { message: /^Must be on branch dev/ });
27
29
  });
28
30
 
29
31
  test.serial('should throw if on negated branch', async t => {
30
32
  const options = { git: { requireBranch: '!main' } };
31
33
  const gitClient = factory(Git, { options });
32
- sh.exec('git checkout -b main');
34
+ sh.exec('git checkout -b main', execOpts);
33
35
  await t.throwsAsync(gitClient.init(), { message: /^Must be on branch !main/ });
34
36
  });
35
37
 
@@ -42,39 +44,39 @@ test.serial('should not throw if required branch matches', async t => {
42
44
  test.serial('should not throw if one of required branch matches', async t => {
43
45
  const options = { git: { requireBranch: ['release/*', 'hotfix/*'] } };
44
46
  const gitClient = factory(Git, { options });
45
- sh.exec('git checkout -b release/v1');
47
+ childProcess.execSync('git checkout -b release/v1', execOpts);
46
48
  await t.notThrowsAsync(gitClient.init());
47
49
  });
48
50
 
49
51
  test.serial('should throw if there is no remote Git url', async t => {
50
52
  const gitClient = factory(Git, { options: { git } });
51
- sh.exec('git remote remove origin');
53
+ childProcess.execSync('git remote remove origin', execOpts);
52
54
  await t.throwsAsync(gitClient.init(), { message: /^Could not get remote Git url/ });
53
55
  });
54
56
 
55
57
  test.serial('should throw if working dir is not clean', async t => {
56
58
  const gitClient = factory(Git, { options: { git } });
57
- sh.exec('rm file');
59
+ childProcess.execSync('rm file', execOpts);
58
60
  await t.throwsAsync(gitClient.init(), { message: /^Working dir must be clean/ });
59
61
  });
60
62
 
61
63
  test.serial('should throw if no upstream is configured', async t => {
62
64
  const gitClient = factory(Git, { options: { git } });
63
- sh.exec('git checkout -b foo');
65
+ childProcess.execSync('git checkout -b foo', execOpts);
64
66
  await t.throwsAsync(gitClient.init(), { message: /^No upstream configured for current branch/ });
65
67
  });
66
68
 
67
69
  test.serial('should throw if there are no commits', async t => {
68
70
  const options = { git: { requireCommits: true } };
69
71
  const gitClient = factory(Git, { options });
70
- sh.exec('git tag 1.0.0');
72
+ childProcess.execSync('git tag 1.0.0', execOpts);
71
73
  await t.throwsAsync(gitClient.init(), { message: /^There are no commits since the latest tag/ });
72
74
  });
73
75
 
74
76
  test.serial('should not throw if there are commits', async t => {
75
77
  const options = { git: { requireCommits: true } };
76
78
  const gitClient = factory(Git, { options });
77
- sh.exec('git tag 1.0.0');
79
+ childProcess.execSync('git tag 1.0.0', execOpts);
78
80
  gitAdd('line', 'file', 'Add file');
79
81
  await t.notThrowsAsync(gitClient.init(), 'There are no commits since the latest tag');
80
82
  });
@@ -82,29 +84,29 @@ test.serial('should not throw if there are commits', async t => {
82
84
  test.serial('should fail (exit code 1) if there are no commits', async t => {
83
85
  const options = { git: { requireCommits: true } };
84
86
  const gitClient = factory(Git, { options });
85
- sh.exec('git tag 1.0.0');
87
+ childProcess.execSync('git tag 1.0.0', execOpts);
86
88
  await t.throwsAsync(gitClient.init(), { code: 1 });
87
89
  });
88
90
 
89
91
  test.serial('should not fail (exit code 0) if there are no commits', async t => {
90
92
  const options = { git: { requireCommits: true, requireCommitsFail: false } };
91
93
  const gitClient = factory(Git, { options });
92
- sh.exec('git tag 1.0.0');
94
+ childProcess.execSync('git tag 1.0.0', execOpts);
93
95
  await t.throwsAsync(gitClient.init(), { code: 0 });
94
96
  });
95
97
 
96
98
  test.serial('should throw if there are no commits in specified path', async t => {
97
99
  const options = { git: { requireCommits: true, commitsPath: 'dir' } };
98
100
  const gitClient = factory(Git, { options });
99
- sh.mkdir('dir');
100
- sh.exec('git tag 1.0.0');
101
+ mkdirSync('dir', { recursive: true });
102
+ sh.exec('git tag 1.0.0', execOpts);
101
103
  await t.throwsAsync(gitClient.init(), { message: /^There are no commits since the latest tag/ });
102
104
  });
103
105
 
104
106
  test.serial('should not throw if there are commits in specified path', async t => {
105
107
  const options = { git: { requireCommits: true, commitsPath: 'dir' } };
106
108
  const gitClient = factory(Git, { options });
107
- sh.exec('git tag 1.0.0');
109
+ sh.exec('git tag 1.0.0', execOpts);
108
110
  gitAdd('line', 'dir/file', 'Add file');
109
111
  await t.notThrowsAsync(gitClient.init());
110
112
  });
@@ -117,14 +119,14 @@ test.serial('should not throw if there are no tags', async t => {
117
119
  });
118
120
 
119
121
  test.serial('should not throw if origin remote is renamed', async t => {
120
- sh.exec('git remote rename origin upstream');
122
+ childProcess.execSync('git remote rename origin upstream', execOpts);
121
123
  const gitClient = factory(Git);
122
124
  await t.notThrowsAsync(gitClient.init());
123
125
  });
124
126
 
125
127
  test.serial('should detect and include version prefix ("v")', async t => {
126
128
  const gitClient = factory(Git, { options: { git } });
127
- sh.exec('git tag v1.0.0');
129
+ childProcess.execSync('git tag v1.0.0', execOpts);
128
130
  await gitClient.init();
129
131
  await gitClient.bump('1.0.1');
130
132
  t.is(gitClient.config.getContext('tagName'), 'v1.0.1');
@@ -132,7 +134,7 @@ test.serial('should detect and include version prefix ("v")', async t => {
132
134
 
133
135
  test.serial('should detect and exclude version prefix', async t => {
134
136
  const gitClient = factory(Git, { options: { git } });
135
- sh.exec('git tag 1.0.0');
137
+ childProcess.execSync('git tag 1.0.0', execOpts);
136
138
  await gitClient.init();
137
139
  await gitClient.bump('1.0.1');
138
140
  t.is(gitClient.config.getContext('tagName'), '1.0.1');
@@ -140,7 +142,7 @@ test.serial('should detect and exclude version prefix', async t => {
140
142
 
141
143
  test.serial('should detect and exclude version prefix (configured)', async t => {
142
144
  const gitClient = factory(Git, { options: { git: { tagName: 'v${version}' } } });
143
- sh.exec('git tag 1.0.0');
145
+ childProcess.execSync('git tag 1.0.0', execOpts);
144
146
  await gitClient.init();
145
147
  await gitClient.bump('1.0.1');
146
148
  t.is(gitClient.config.getContext('tagName'), 'v1.0.1');
@@ -148,7 +150,7 @@ test.serial('should detect and exclude version prefix (configured)', async t =>
148
150
 
149
151
  test.serial('should honor custom tagName configuration', async t => {
150
152
  const gitClient = factory(Git, { options: { git: { tagName: 'TAGNAME-${repo.project}-v${version}' } } });
151
- sh.exec('git tag 1.0.0');
153
+ childProcess.execSync('git tag 1.0.0', execOpts);
152
154
  await gitClient.init();
153
155
  await gitClient.bump('1.0.1');
154
156
  const { project } = gitClient.getContext('repo');
@@ -160,12 +162,13 @@ test.serial('should get the latest tag after fetch', async t => {
160
162
  const gitClient = factory(Git, { container: { shell } });
161
163
  const { bare, target } = t.context;
162
164
  const other = mkTmpDir();
163
- sh.exec('git push');
164
- sh.exec(`git clone ${bare} ${other}`);
165
- sh.pushd('-q', other);
166
- sh.exec('git tag 1.0.0');
167
- sh.exec('git push --tags');
168
- sh.pushd('-q', target);
165
+ childProcess.execSync('git push', execOpts);
166
+ childProcess.execSync(`git clone ${bare} ${other}`, execOpts);
167
+
168
+ process.chdir(other);
169
+ childProcess.execSync('git tag 1.0.0', execOpts);
170
+ childProcess.execSync('git push --tags', execOpts);
171
+ process.chdir(target);
169
172
  await gitClient.init();
170
173
  t.is(gitClient.config.getContext('latestTag'), '1.0.0');
171
174
  });
@@ -178,14 +181,14 @@ test.serial('should get the latest custom tag after fetch when tagName is config
178
181
  });
179
182
  const { bare, target } = t.context;
180
183
  const other = mkTmpDir();
181
- sh.exec('git push');
182
- sh.exec(`git clone ${bare} ${other}`);
183
- sh.pushd('-q', other);
184
- sh.exec('git tag TAGNAME-OTHER-v2.0.0');
185
- sh.exec('git tag TAGNAME-v1.0.0');
186
- sh.exec('git tag TAGNAME-OTHER-v2.0.2');
187
- sh.exec('git push --tags');
188
- sh.pushd('-q', target);
184
+ childProcess.execSync('git push', execOpts);
185
+ childProcess.execSync(`git clone ${bare} ${other}`, execOpts);
186
+ process.chdir(other);
187
+ childProcess.execSync('git tag TAGNAME-OTHER-v2.0.0', execOpts);
188
+ childProcess.execSync('git tag TAGNAME-v1.0.0', execOpts);
189
+ childProcess.execSync('git tag TAGNAME-OTHER-v2.0.2', execOpts);
190
+ childProcess.execSync('git push --tags', execOpts);
191
+ process.chdir(target);
189
192
  await gitClient.init();
190
193
  t.is(gitClient.config.getContext('latestTag'), 'TAGNAME-v1.0.0');
191
194
  });
@@ -196,10 +199,10 @@ test.serial('should get the latest tag based on tagMatch', async t => {
196
199
  options: { git: { tagMatch: '[0-9][0-9]\\.[0-1][0-9]\\.[0-9]*' } },
197
200
  container: { shell }
198
201
  });
199
- sh.exec('git tag 1.0.0');
200
- sh.exec('git tag 21.04.3');
201
- sh.exec('git tag 1.0.1');
202
- sh.exec('git push --tags');
202
+ childProcess.execSync('git tag 1.0.0', execOpts);
203
+ childProcess.execSync('git tag 21.04.3', execOpts);
204
+ childProcess.execSync('git tag 1.0.1', execOpts);
205
+ childProcess.execSync('git push --tags', execOpts);
203
206
  await gitClient.init();
204
207
  t.is(gitClient.config.getContext('latestTag'), '21.04.3');
205
208
  });
@@ -210,20 +213,20 @@ test.serial('should get the latest tag based on tagExclude', async t => {
210
213
  options: { git: { tagExclude: '*[-]*' } },
211
214
  container: { shell }
212
215
  });
213
- sh.exec('git tag 1.0.0');
214
- sh.exec('git commit --allow-empty -m "commit 1"');
215
- sh.exec('git tag 1.0.1-rc.0');
216
- sh.exec('git tag 1.0.1');
217
- sh.exec('git commit --allow-empty -m "commit 2"');
218
- sh.exec('git tag 1.1.0-rc.0');
219
- sh.exec('git push --tags');
216
+ childProcess.execSync('git tag 1.0.0', execOpts);
217
+ childProcess.execSync('git commit --allow-empty -m "commit 1"', execOpts);
218
+ childProcess.execSync('git tag 1.0.1-rc.0', execOpts);
219
+ childProcess.execSync('git tag 1.0.1', execOpts);
220
+ childProcess.execSync('git commit --allow-empty -m "commit 2"', execOpts);
221
+ childProcess.execSync('git tag 1.1.0-rc.0', execOpts);
222
+ childProcess.execSync('git push --tags', execOpts);
220
223
  await gitClient.init();
221
224
  t.is(gitClient.config.getContext('latestTag'), '1.0.1');
222
225
  });
223
226
 
224
227
  test.serial('should generate correct changelog', async t => {
225
228
  const gitClient = factory(Git, { options: { git } });
226
- sh.exec('git tag 1.0.0');
229
+ childProcess.execSync('git tag 1.0.0', execOpts);
227
230
  gitAdd('line', 'file', 'Add file');
228
231
  gitAdd('line', 'file', 'Add file');
229
232
  await gitClient.init();
@@ -237,11 +240,11 @@ test.serial('should get the full changelog since latest major tag', async t => {
237
240
  options: { git: { tagMatch: '[0-9]\\.[0-9]\\.[0-9]', changelog: git.changelog } },
238
241
  container: { shell }
239
242
  });
240
- sh.exec('git tag 1.0.0');
243
+ childProcess.execSync('git tag 1.0.0', execOpts);
241
244
  gitAdd('line', 'file', 'Add file');
242
- sh.exec('git tag 2.0.0-rc.0');
245
+ childProcess.execSync('git tag 2.0.0-rc.0', execOpts);
243
246
  gitAdd('line', 'file', 'Add file');
244
- sh.exec('git tag 2.0.0-rc.1');
247
+ childProcess.execSync('git tag 2.0.0-rc.1', execOpts);
245
248
  gitAdd('line', 'file', 'Add file');
246
249
  await gitClient.init();
247
250
  t.is(gitClient.config.getContext('latestTag'), '1.0.0');