forked from lcherone/composer-package-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-build.sh
72 lines (52 loc) · 1.31 KB
/
dev-build.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#
# Build.sh -
# Helper script which monitors changes, builds then starts php
# inbuilt server to run test script.
#
# Works most of the time; but sometimes throws segfault when starting php server :/
#
#if [[ $EUID -ne 0 ]]; then
# echo "This script must be run as root: sudo bash build.sh"
# exit 1
#fi
SRC="src"
VENDOR="vendor"
#TST="../../php_inbuilt/code"
function block {
inotifywait -q -r -e modify,move,create,delete $SRC $VENDOR
}
#function stop_php_server {
# for pid in $(ps -ef | awk '/php -S 0.0.0.0/{print $2}'); do
# echo "Killing PHP process: $pid"
# sudo kill -9 $pid
# done
#}
#function start_php_server {
# sudo nohup php -S 0.0.0.0:81 -t "$TST" >nohup.out 2>&1 &
#}
#function run_test_script {
# time php $TST/client.php
#}
function main {
clear
/usr/bin/php -c /etc/php/7.0/cli/php.ini -f box.phar build -v
clear
/usr/bin/php package-generator.phar -w
#echo "Stopping PHP inbuilt server"
#stop_php_server
# build extension
#echo "Building $SRC extension"
#zephir install
#sleep 1
#echo "Starting PHP inbuilt server"
#start_php_server
#sleep 5
#echo "Executing test script"
#echo "---------------------"
#run_test_script
}
main
while block; do
main
done