forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-simdutf.sh
executable file
·52 lines (40 loc) · 1.32 KB
/
update-simdutf.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e
# Shell script to update simdutf in the source tree to a specific version
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
DEPS_DIR="$BASE_DIR/deps"
SIMDUTF_VERSION=$1
if [ "$#" -le 0 ]; then
echo "Error: please provide an simdutf version to update to"
echo " e.g. $0 2.0.3"
exit 1
fi
echo "Making temporary workspace..."
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
cleanup () {
EXIT_CODE=$?
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
exit $EXIT_CODE
}
trap cleanup INT TERM EXIT
SIMDUTF_REF="v$SIMDUTF_VERSION"
SIMDUTF_ZIP="simdutf-$SIMDUTF_VERSION.zip"
SIMDUTF_LICENSE="LICENSE-MIT"
cd "$WORKSPACE"
echo "Fetching simdutf source archive..."
curl -sL -o "$SIMDUTF_ZIP" "https://github.com/simdutf/simdutf/releases/download/$SIMDUTF_REF/singleheader.zip"
unzip "$SIMDUTF_ZIP"
rm "$SIMDUTF_ZIP"
rm ./*_demo.cpp
curl -sL -o "$SIMDUTF_LICENSE" "https://raw.githubusercontent.com/simdutf/simdutf/HEAD/LICENSE-MIT"
echo "Replacing existing simdutf (except GYP build files)"
mv "$DEPS_DIR/simdutf/"*.gyp "$DEPS_DIR/simdutf/README.md" "$WORKSPACE/"
rm -rf "$DEPS_DIR/simdutf"
mv "$WORKSPACE" "$DEPS_DIR/simdutf"
echo "All done!"
echo ""
echo "Please git add simdutf, commit the new version:"
echo ""
echo "$ git add -A deps/simdutf"
echo "$ git commit -m \"deps: update simdutf to $SIMDUTF_VERSION\""
echo ""