forked from yarnpkg/berry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-resolve-patch.sh
More file actions
25 lines (18 loc) Β· 833 Bytes
/
gen-resolve-patch.sh
File metadata and controls
25 lines (18 loc) Β· 833 Bytes
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
set -ex
THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)
TEMP_DIR="$(mktemp -d)"
mkdir -p "$TEMP_DIR"/orig
mkdir -p "$TEMP_DIR"/patched
cd "$TEMP_DIR"/orig
wget -q https://registry.yarnpkg.com/resolve/-/resolve-1.14.1.tgz
tar xvfz resolve-1.14.1.tgz 2> /dev/null
cd "$TEMP_DIR"/patched
cp "$TEMP_DIR"/orig/resolve-1.14.1.tgz .
tar xvfz resolve-1.14.1.tgz 2> /dev/null
cp "$THIS_DIR"/normalize-options.js "$TEMP_DIR"/patched/package/lib/normalize-options.js
git diff --no-index "$TEMP_DIR"/orig/package "$TEMP_DIR"/patched/package \
| perl -p -e"s#^--- #semver exclusivity >=1.9\n--- #" \
| perl -p -e"s#$TEMP_DIR/orig/package##" \
| perl -p -e"s#$TEMP_DIR/patched/package##" \
> "$TEMP_DIR"/patch.tmp
node "$THIS_DIR/../createPatch.js" "$TEMP_DIR"/patch.tmp "$THIS_DIR"/../../sources/patches/resolve.patch.ts