@@ -31,10 +31,6 @@ error() {
31
31
exit 1;
32
32
}
33
33
34
- # NOTE
35
- # `cargo get workspace.members` display the list of path to crates in the workspace.
36
- # for the `cargo set-version` command, we need the name of the module (last element of the path).
37
-
38
34
readonly ORANGE=" \e[1;33m"
39
35
readonly GREEN=" \e[1;32m"
40
36
readonly RESET=" \e[0m"
@@ -44,6 +40,10 @@ declare OPEN_API_UPDATE=""
44
40
declare OPEN_API_UPDATE_MESSAGE=" "
45
41
46
42
update_crate_versions () {
43
+ # NOTE
44
+ # `cargo get workspace.members` display the list of path to crates in the workspace.
45
+ # for the `cargo set-version` command, we need the name of the module (last element of the path).
46
+ #
47
47
local -r dry_run=$1
48
48
local -r -n files_modify=$2
49
49
local -r -a members=" $( cargo get workspace.members --delimiter " " ) "
@@ -173,6 +173,26 @@ if [ true = $DRY_RUN ]
173
173
then
174
174
echo -e " ${ORANGE} warning${RESET} : script is run in dry mode. To apply the changes, run ${GREEN} $0 --run${RESET} "
175
175
else
176
+ # NOTE
177
+ # The goal is to transform individual `git diff` formatted output to a list item with the crate or package name and the version change.
178
+ # ie, transform this:
179
+ # ```
180
+ # diff --git a/mithril-explorer/package.json b/mithril-explorer/package.json
181
+ # index 20f2e0030..e0e680d52 100644
182
+ # --- a/mithril-explorer/package.json
183
+ # +++ b/mithril-explorer/package.json
184
+ # @@ -1,6 +1,6 @@
185
+ # {
186
+ # "name": "mithril-explorer",
187
+ # - "version": "0.7.19",
188
+ # + "version": "0.7.20",
189
+ # "private": true,
190
+ # "scripts": {
191
+ # "dev": "next dev",
192
+ # ```
193
+ # to this:
194
+ # `* [js] mithril-explorer from `0.7.18` to `0.7.19``
195
+ #
176
196
UPDATED_CRATES=" $( find . -name Cargo.toml -exec git diff " $COMMIT_REF " {} + | grep -E " ^[\+\-]version = \" [0-9\.]+\" |name = " | tr ' \n' ' ' | sed -r " s/ name = \" ([a-z\-]+)\" -version = \" ([0-9\.]+)\" \+version = \" ([0-9\.]+)\" ?/* \1 from \` \2\` to \` \3\` \n/g" ) "
177
197
if [[ -n $UPDATED_CRATES ]]
178
198
then
0 commit comments