diff options
| -rwxr-xr-x | set-pwd.sh | 7 | ||||
| -rwxr-xr-x | start | 1 |
2 files changed, 5 insertions, 3 deletions
@@ -1,9 +1,10 @@ #!/bin/sh files="api/change-order.php api/export.php api/add.php api/remove.php src/data.php" -[ -z "$1" ] && echo "\$1 has to be directory where project lives" && exit 1 -path="$(readlink -e "$1")" +[ -z "$1" ] && cwd="." || cwd="$1" + +path="$(readlink -e "$cwd")" for file in $files; do - sed -i "s;%PWD%;$1/;" "$file" + sed -i "s;%PWD%;$path/;" "$file" done @@ -1,2 +1,3 @@ #!/bin/sh +./set-pwd.sh php -S 0.0.0.0:8000 |
