Skip to content

Commit 1a5cddf

Browse files
aduh95MoLow
authored andcommitted
tools: harmonize dep_updaters scripts
PR-URL: #48201 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 19ad471 commit 1a5cddf

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

tools/dep_updaters/update-acorn.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ rm -rf deps/acorn/acorn
3434
"$NODE" "$NPM" init --yes
3535

3636
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "acorn@$NEW_VERSION"
37-
cd node_modules/acorn
38-
# update this version information in src/acorn_version.h
39-
FILE_PATH="$ROOT/src/acorn_version.h"
40-
echo "// This is an auto generated file, please do not edit." > "$FILE_PATH"
41-
echo "// Refer to tools/update-acorn.sh" >> "$FILE_PATH"
42-
echo "#ifndef SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
43-
echo "#define SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
44-
echo "#define ACORN_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH"
45-
echo "#endif // SRC_ACORN_VERSION_H_" >> "$FILE_PATH"
4637
)
4738

39+
# update version information in src/acorn_version.h
40+
cat > "$ROOT/src/acorn_version.h" <<EOF
41+
// This is an auto generated file, please do not edit.
42+
// Refer to tools/update-acorn.sh
43+
#ifndef SRC_ACORN_VERSION_H_
44+
#define SRC_ACORN_VERSION_H_
45+
#define ACORN_VERSION "$NEW_VERSION"
46+
#endif // SRC_ACORN_VERSION_H_
47+
EOF
48+
4849
mv acorn-tmp/node_modules/acorn deps/acorn
4950

5051
rm -rf acorn-tmp/
@@ -53,7 +54,7 @@ echo "All done!"
5354
echo ""
5455
echo "Please git add acorn, commit the new version:"
5556
echo ""
56-
echo "$ git add -A deps/acorn"
57+
echo "$ git add -A deps/acorn src/acorn_version.h"
5758
echo "$ git commit -m \"deps: update acorn to $NEW_VERSION\""
5859
echo ""
5960

tools/dep_updaters/update-base64.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ echo "All done!"
6363
echo ""
6464
echo "Please git add base64/base64, commit the new version:"
6565
echo ""
66-
echo "$ git add -A deps/base64/base64"
66+
echo "$ git add -A deps/base64/base64 src/base64_version.h"
6767
echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\""
6868
echo ""
6969

tools/dep_updaters/update-cjs-module-lexer.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ echo "All done!"
5454
echo ""
5555
echo "Please git add cjs-module-lexer, commit the new version:"
5656
echo ""
57-
echo "$ git add -A deps/cjs-module-lexer"
57+
echo "$ git add -A deps/cjs-module-lexer src/cjs_module_lexer_version.h"
5858
echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\""
5959
echo ""
6060

tools/dep_updaters/update-undici.sh

+18-8
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,32 @@ rm -f deps/undici/undici.js
3636
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "undici@$NEW_VERSION"
3737
cd node_modules/undici
3838
"$NODE" "$NPM" run build:node
39-
# update this version information in src/undici_version.h
40-
FILE_PATH="$ROOT/src/undici_version.h"
41-
echo "// This is an auto generated file, please do not edit." > "$FILE_PATH"
42-
echo "// Refer to tools/update-undici.sh" >> "$FILE_PATH"
43-
echo "#ifndef SRC_UNDICI_VERSION_H_" >> "$FILE_PATH"
44-
echo "#define SRC_UNDICI_VERSION_H_" >> "$FILE_PATH"
45-
echo "#define UNDICI_VERSION \"$NEW_VERSION\"" >> "$FILE_PATH"
46-
echo "#endif // SRC_UNDICI_VERSION_H_" >> "$FILE_PATH"
4739
)
4840

41+
# update version information in src/undici_version.h
42+
cat > "$ROOT/src/undici_version.h" <<EOF
43+
// This is an auto generated file, please do not edit.
44+
// Refer to tools/update-undici.sh
45+
#ifndef SRC_UNDICI_VERSION_H_
46+
#define SRC_UNDICI_VERSION_H_
47+
#define UNDICI_VERSION "$NEW_VERSION"
48+
#endif // SRC_UNDICI_VERSION_H_
49+
EOF
50+
4951
mv undici-tmp/node_modules/undici deps/undici/src
5052
mv deps/undici/src/undici-fetch.js deps/undici/undici.js
5153
cp deps/undici/src/LICENSE deps/undici/LICENSE
5254

5355
rm -rf undici-tmp/
5456

57+
echo "All done!"
58+
echo ""
59+
echo "Please git add and commit the new version:"
60+
echo ""
61+
echo "$ git add -A deps/undici src/undici_version.h"
62+
echo "$ git commit -m \"deps: update Undici to $NEW_VERSION\""
63+
echo ""
64+
5565
# The last line of the script should always print the new version,
5666
# as we need to add it to $GITHUB_ENV variable.
5767
echo "NEW_VERSION=$NEW_VERSION"

0 commit comments

Comments
 (0)