-
Notifications
You must be signed in to change notification settings - Fork 14
/
zipplugin.sh
executable file
·31 lines (24 loc) · 762 Bytes
/
zipplugin.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
31
#!/bin/bash
if [[ $# -ne 3 ]]; then
>&2 echo "Usage: zipplugin.sh <projectdir> <builddir> <zipfilename>"
exit 1
fi
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
projectdir=$1
builddir=$2
zipfilename=$3
echo "scriptdir=$scriptdir"
echo "projectdir=$projectdir"
echo "builddir=$builddir"
echo "zipfilename=$zipfilename"
if [ -z "$(which zip)" ]; then
>&2 echo "This script requires the zip utility for packaging external plugins"
exit 1
fi
if [ -f "$zipfilename" ]; then
rm -f $zipfilename
fi
$pluginbindir = $(dirname $zipfilename)
mkdir -p $pluginbindir
cp $projectdir/Manifest.json $builddir
cd $builddir && zip -r $zipfilename . -x netcoreapp2.2/ -x netcoreapp2.2/* -x netcoreapp2/publish/ -x netcoreapp2.2/publish/*