commit-and-tag-version 10.0.0 → 10.0.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/CHANGELOG.md +7 -0
- package/lib/updaters/index.js +13 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [10.0.1](https://github.com/absolute-version/commit-and-tag-version/compare/v10.0.0...v10.0.1) (2022-05-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* No longer warn inappropriately when a custom updater is provided as an object ([5eb8886](https://github.com/absolute-version/commit-and-tag-version/commit/5eb8886a56c6b14c13544192edb3d0e18f91184a))
|
|
11
|
+
|
|
5
12
|
## [10.0.0](https://github.com/absolute-version/commit-and-tag-version/compare/v9.6.0...v10.0.0) (2022-05-25)
|
|
6
13
|
|
|
7
14
|
|
package/lib/updaters/index.js
CHANGED
|
@@ -44,6 +44,7 @@ function getCustomUpdaterFromPath (updater) {
|
|
|
44
44
|
*/
|
|
45
45
|
function isValidUpdater (obj) {
|
|
46
46
|
return (
|
|
47
|
+
obj &&
|
|
47
48
|
typeof obj.readVersion === 'function' &&
|
|
48
49
|
typeof obj.writeVersion === 'function'
|
|
49
50
|
)
|
|
@@ -63,16 +64,19 @@ module.exports.resolveUpdaterObjectFromArgument = function (arg) {
|
|
|
63
64
|
filename: arg
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
|
|
68
|
+
if (!isValidUpdater(updater.updater)) {
|
|
69
|
+
try {
|
|
70
|
+
if (typeof updater.updater === 'string') {
|
|
71
|
+
updater.updater = getCustomUpdaterFromPath(updater.updater)
|
|
72
|
+
} else if (updater.type) {
|
|
73
|
+
updater.updater = getUpdaterByType(updater.type)
|
|
74
|
+
} else {
|
|
75
|
+
updater.updater = getUpdaterByFilename(updater.filename)
|
|
76
|
+
}
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if (err.code !== 'ENOENT') console.warn(`Unable to obtain updater for: ${JSON.stringify(arg)}\n - Error: ${err.message}\n - Skipping...`)
|
|
73
79
|
}
|
|
74
|
-
} catch (err) {
|
|
75
|
-
if (err.code !== 'ENOENT') console.warn(`Unable to obtain updater for: ${JSON.stringify(arg)}\n - Error: ${err.message}\n - Skipping...`)
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* We weren't able to resolve an updater for the argument.
|