-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.sh
30 lines (23 loc) · 785 Bytes
/
pack.sh
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
blockname="dependencies"
composedname="wp-idg-ufr__block-$blockname"
if ! command -v npm &> /dev/null
then
echo "npm is not installed: install npm with 'sudo apt-get install npm'"
exit 1
fi
if ! command -v zip &> /dev/null
then
echo "zip is not installed: install zip with 'sudo apt-get install zip'"
exit 1
fi
rm $composedname.zip
npm run build &&
mkdir -p $composedname/node_modules/regenerator-runtime &&
cp -r ./lib ./$composedname &&
cp -r ./assets ./$composedname &&
cp ./index.js ./$composedname &&
cp ./node_modules/regenerator-runtime/runtime.js ./$composedname/node_modules/regenerator-runtime/runtime.js &&
cp ./$composedname.php ./$composedname &&
zip $composedname.zip ./$composedname -r &&
rm -rf ./$composedname &&
echo "Done. Packed file: $composedname.zip"