summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2023-04-11 20:23:08 +0200
committerMaksymilian Jopek <maks@jopek.eu>2023-04-11 20:23:08 +0200
commit63df1743af26feb36b11398afa561c317bc1d517 (patch)
tree93f250759fbc2a49b4b34e0b8437bb70fe54bb99
parent19218d758d4fc0f8f5db5a97eb9dcfdb5086f844 (diff)
downloadmlos-master.tar.gz
mlos-master.tar.zst
mlos-master.zip
Fix starting the projectHEADmaster
-rwxr-xr-xset-pwd.sh7
-rwxr-xr-xstart1
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