release-it 19.2.0 → 19.2.1
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/lib/plugin/git/prompts.js +5 -2
- package/lib/util.js +2 -1
- package/package.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { format, truncateLines } from '../../util.js';
|
|
1
|
+
import { format, truncateLines, fixArgs } from '../../util.js';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
commit: {
|
|
5
5
|
type: 'confirm',
|
|
6
|
-
message: context =>
|
|
6
|
+
message: context => {
|
|
7
|
+
if (fixArgs(context.git.commitArgs).includes('--amend')) return 'Amend commit?';
|
|
8
|
+
return `Commit (${truncateLines(format(context.git.commitMessage, context), 1, ' [...]')})?`;
|
|
9
|
+
},
|
|
7
10
|
default: true
|
|
8
11
|
},
|
|
9
12
|
tag: {
|
package/lib/util.js
CHANGED
|
@@ -63,7 +63,8 @@ export const getSystemInfo = () => {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export const format = (template = '', context = {}) => {
|
|
66
|
-
if (!
|
|
66
|
+
if (!template || typeof template !== 'string') return '';
|
|
67
|
+
if (!context || context === null || template.indexOf('${') === -1) return template;
|
|
67
68
|
const log = new Log();
|
|
68
69
|
try {
|
|
69
70
|
return eta.renderString(template, context);
|