learngerman/extraer.sh

41 lines
832 B
Bash
Raw Permalink Normal View History

2021-10-12 01:25:39 +00:00
#!/bin/sh
big () {
echo '==================================='
echo "$1"
echo '==================================='
}
rm -rf orig
mkdir -p orig
cd orig || exit
big 'Extrayendo código de los source maps'
for f in ../maps/*.map; do
node ../source-from-sourcemaps.js "$f"
done
mv sources-gen/* .
rm -r sources-gen
# Por alguna razón un CSS se extrae ahí
cp -r src/components/* ./components/
big '.js -> .jsx'
find . -iname '*.js' -exec mv {} {}x \;
big 'Parcheando .svg'
find . -iname '*.svg' -exec sh -c '
echo "const __webpack_public_path__ = \"https://learngerman.dw.com/\";" > "${1}.js"
cat "$1" >> "${1}.js"
rm "$1"
' sh {} \;
big 'Copiando archivos de static/'
cp -r ../static/* ./
big 'Parcheando...'
for f in ../patches/*; do
echo "--> Parche $f"
patch -p1 < "$f"
done
big 'DONE. Código extraido en "orig".'