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
|
#!/bin/sh
set -e
PKG=typescript-types
VER=$(date +'%Y%m%d')
packages="backbone
chai
expect.js
fs-extra
handlebars
highlight.js
jquery
jsdom
lodash
marked
mathjax
minimatch
minimist
mocha
node
requirejs
semver
shelljs
sinon
sizzle
underscore"
rm -rf dl "$PKG-$VER"
mkdir -p dl
cd dl
for p in $packages; do
echo >&2 -n "downloading $p"
version=$(wget -q -O - "https://registry.npmjs.org/-/package/@types%2F${p}/dist-tags" | \
python3 -m json.tool | \
sed -ne 's/.*"latest": "\(.*\)".*/\1/gp')
echo " $version"
wget -qO- "https://registry.npmjs.org/@types/$p/-/$p-${version}.tgz" | tar -xzf-
printf "%-40s%s\n" "@types/$p" "$version" >> packages.list
done
cd ..
mv dl "$PKG-$VER"
tar --sort=name \
--owner=root --group=root \
-cJf "${PKG}_${VER}.orig.tar.xz" "$PKG-$VER"
rm -rf "$PKG-$VER"
|