From 63df1743af26feb36b11398afa561c317bc1d517 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Tue, 11 Apr 2023 20:23:08 +0200 Subject: Fix starting the project --- set-pwd.sh | 7 ++++--- start | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/set-pwd.sh b/set-pwd.sh index c6963f5..1ed18c2 100755 --- a/set-pwd.sh +++ b/set-pwd.sh @@ -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 diff --git a/start b/start index c3a84e0..8e63dcd 100755 --- a/start +++ b/start @@ -1,2 +1,3 @@ #!/bin/sh +./set-pwd.sh php -S 0.0.0.0:8000 -- cgit v1.3.1