-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathinstall.sh
33 lines (29 loc) · 976 Bytes
/
install.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
32
33
#!/bin/bash
# when git clone source to local and use this script to install depends
# Install from source, not by composer
set -e
set -x
# composer.json must at root directory
# copy composer.json to current directory, change autoload path to current dir
if [ ! -f "composer.json" ]; then
cp ../../composer.json .
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sed -i -e "s#php/midi/src#src#g" composer.json
sed -i -e "s#php/midi/tests#tests#g" composer.json
sed -i -e "s#php/midi/bin#bin#g" composer.json
sed -i -e "s#php/midi/res#res#g" composer.json
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' -e "s#php/midi/src#src#g" composer.json
sed -i '' -e "s#php/midi/tests#tests#g" composer.json
sed -i '' -e "s#php/midi/bin#bin#g" composer.json
sed -i '' -e "s#php/midi/res#res#g" composer.json
else
echo "Not Support $OSTYPE"
exit 1
fi
# composer install depends
if [ -d "vendor" ]; then
rm -rf vendor
fi
composer install -o