forked from j3k0/cordova-plugin-openwith
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-pmd
executable file
·38 lines (30 loc) · 727 Bytes
/
install-pmd
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
32
33
34
35
36
37
38
#!/bin/sh
# Version of PMD to install
VERSION=5.8.1
set -e
COPYWD="$PWD"
cd "`dirname $0`"
INSTALL_DIR=$PWD/node_modules/pmd-bin-$VERSION
BIN_DIR=$PWD/node_modules/.bin
if test -e $INSTALL_DIR; then
# echo "PMD version $VERSION is already installed"
exit 0
fi
echo "Intalling PMD version $VERSION into node_modules"
curl -OL https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip
unzip pmd-bin-$VERSION.zip
rm -f pmd-bin-$VERSION.zip
mkdir -p node_modules
mv pmd-bin-$VERSION > $INSTALL_DIR
cat << EOF > $BIN_DIR/pmd
#!/bin/sh
echo
$INSTALL_DIR/bin/run.sh pmd "\$@"
EOF
chmod +x $BIN_DIR/pmd
cat << EOF > $INSTALL_DIR/package.json
{
"name": "pdm",
"version": "$VERSION"
}
EOF