Skip to content

Commit 2fac041

Browse files
authored
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 40b89c5 commit 2fac041

File tree

4 files changed

+45
-34
lines changed

4 files changed

+45
-34
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

+8-8
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ mv "$WORKSPACE/base64" "$DEPS_DIR/base64/"
6464
# to work, we create it and leave it empty.
6565
echo "// Intentionally empty" >> "$DEPS_DIR/base64/base64/lib/config.h"
6666

67-
echo "All done!"
68-
echo ""
69-
echo "Please git add base64/base64, commit the new version:"
70-
echo ""
71-
echo "$ git add -A deps/base64/base64"
72-
echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\""
73-
echo ""
74-
7567
# update the base64_version.h
7668
cat > "$BASE_DIR/src/base64_version.h" << EOL
7769
// This is an auto generated file, please do not edit.
@@ -82,6 +74,14 @@ cat > "$BASE_DIR/src/base64_version.h" << EOL
8274
#endif // SRC_BASE64_VERSION_H_
8375
EOL
8476

77+
echo "All done!"
78+
echo ""
79+
echo "Please git add base64/base64, commit the new version:"
80+
echo ""
81+
echo "$ git add -A deps/base64/base64 src/base64_version.h"
82+
echo "$ git commit -m \"deps: update base64 to $NEW_VERSION\""
83+
echo ""
84+
8585
# The last line of the script should always print the new version,
8686
# as we need to add it to $GITHUB_ENV variable.
8787
echo "NEW_VERSION=$NEW_VERSION"

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ rm -rf "$DEPS_DIR/cjs-module-lexer"
5555

5656
mv node_modules/cjs-module-lexer "$DEPS_DIR/cjs-module-lexer"
5757

58-
echo "All done!"
59-
echo ""
60-
echo "Please git add cjs-module-lexer, commit the new version:"
61-
echo ""
62-
echo "$ git add -A deps/cjs-module-lexer"
63-
echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\""
64-
echo ""
65-
6658
# update cjs_module_lexer_version.h
6759
cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL
6860
// This is an auto generated file, please do not edit.
@@ -73,6 +65,14 @@ cat > "$BASE_DIR/src/cjs_module_lexer_version.h" << EOL
7365
#endif // SRC_CJS_MODULE_LEXER_VERSION_H_
7466
EOL
7567

68+
echo "All done!"
69+
echo ""
70+
echo "Please git add cjs-module-lexer, commit the new version:"
71+
echo ""
72+
echo "$ git add -A deps/cjs-module-lexer src/cjs_module_lexer_version.h"
73+
echo "$ git commit -m \"deps: update cjs-module-lexer to $NEW_VERSION\""
74+
echo ""
75+
7676
# The last line of the script should always print the new version,
7777
# as we need to add it to $GITHUB_ENV variable.
7878
echo "NEW_VERSION=$NEW_VERSION"

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)