Skip to content

Commit d78268e

Browse files
authored
tools: remove duplicate variables
All our script already define a `BASE_DIR` variable, needed to load `utils.sh`; computing a similar `ROOT` variable in `utils.sh` is pure overhead and needlessly complicates reading the source files. Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #67511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 369b9c8 commit d78268e

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎tools/dep_updaters/update-amaro.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rm -rf node_modules
6060
mv ./* "$DEPS_DIR/amaro"
6161

6262
# update version information in src/undici_version.h
63-
cat > "$ROOT/src/amaro_version.h" <<EOF
63+
cat > "$BASE_DIR/src/amaro_version.h" <<EOF
6464
// This is an auto generated file, please do not edit.
6565
// Refer to tools/dep_updaters/update-amaro.sh
6666
#ifndef SRC_AMARO_VERSION_H_

‎tools/dep_updaters/update-c-ares.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ echo "Replacing existing c-ares"
7373
replace_dir "$DEPS_DIR/cares" "$ARES_FOLDER"
7474

7575
echo "Updating cares.gyp"
76-
"$NODE" "$ROOT/tools/dep_updaters/update-c-ares.mjs"
76+
"$NODE" "$BASE_DIR/tools/dep_updaters/update-c-ares.mjs"
7777

7878
# Update the version number on maintaining-dependencies.md
7979
# and print the new version as the last line of the script as we need

‎tools/dep_updaters/utils.sh‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/sh
22

3-
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
4-
export ROOT
5-
63
# This function compare new version with current version of a dependency and
74
# exit the script if the versions are the same
85
#

0 commit comments

Comments
 (0)