js-d3-flame-graph/create_dependency_bundle.sh
Petr Šabata 76a07d4301 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/js-d3-flame-graph#cf6f98f52167dcb2a941d2a8ec6cddc2c134d5bb
2020-10-15 14:22:12 +02:00

35 lines
565 B
Bash
Executable File

#!/bin/bash -eu
SRC=$(readlink -f "${1:?Usage: $0 source destination}")
DEST=$(readlink -f "${2:?Usage: $0 source destination}")
if [ -f "$DEST" ]; then
echo "File $DEST exists already."
exit 0
fi
if [ "$#" -gt 2 ]; then
PATCHES=$(readlink -f "${@:3}")
else
PATCHES=""
fi
pushd "$(mktemp -d)"
echo Extracting sources...
tar xfz "$SRC"
cd d3-flame-graph-*
echo Applying patches...
for patch in $PATCHES
do
patch -p1 < $patch
done
echo Installing dependencies...
npm install
echo Compressing...
XZ_OPT=-9 tar cJf "$DEST" node_modules
popd