-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·29 lines (21 loc) · 876 Bytes
/
package.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
#!/bin/bash
mkdir -p dist
# Remove old packages
rm -rf ./dist/gravity-forms-encryption ./dist/gravity-forms-encryption.zip
# Copy current dir to tmp
rsync -ua . ./dist/gravity-forms-encryption/
# Remove current vendor folder (if any) and install
# the dependencies without dev packages.
cd ./dist/gravity-forms-encryption || exit
rm -rf ./vendor/
composer install -o --no-dev
# Remove unneeded files in a WordPress plugin
rm -rf ./.git ./composer.json ./composer.lock ./package.sh \
./.vscode ./workspace.code-workspace ./bitbucket-pipelines.yml \
./phpunit.xml.dist ./.phplint-cache ./.phpunit.result.cache \
./psalm.xml ./tests ./dist
cd ../
# Create a zip file from the optimized plugin folder
zip -rq gravity-forms-encryption.zip ./gravity-forms-encryption
rm -rf ./gravity-forms-encryption
echo "Zip completed @ $(pwd)/gravity-forms-encryption.zip"