Skip to content

Commit 8896707

Browse files
authored
test/integration/deps: add script: get-postfixed-pouchdb-build (#8622)
1 parent 71501f8 commit 8896707

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash -eu
2+
3+
# Download a pouchdb production build for testing inter-version migrations in
4+
# tests/integration/browser.migration.js
5+
6+
log() {
7+
echo "[get-postfixed-pouchdb-build] $*"
8+
}
9+
10+
# Recently, postfixed JS files have been added in minified form.
11+
infix=".min"
12+
while [[ $# -gt 1 ]]; do
13+
if [[ $1 = --no-minify ]]; then
14+
infix=""
15+
else
16+
echo "!!! Unrecognised arg: $1"
17+
exit 1
18+
fi
19+
shift
20+
done
21+
22+
version="$1"
23+
target="./pouchdb-$version-postfixed.js"
24+
nodots="$(tr -d . <<<"$version")"
25+
tmp="$(mktemp)"
26+
27+
log "Fetching minified pouch build..."
28+
wget "https://github.com/pouchdb/pouchdb/releases/download/$version/pouchdb-${version}${infix}.js" --output-document="$tmp"
29+
30+
log "Converting globals..."
31+
sed "s/PouchDB/PouchDBVersion$nodots/g" "$tmp" > "$target"
32+
33+
log "Completed OK."

0 commit comments

Comments
 (0)