diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2023-04-11 20:23:08 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2023-04-11 20:23:08 +0200 |
| commit | 63df1743af26feb36b11398afa561c317bc1d517 (patch) | |
| tree | 93f250759fbc2a49b4b34e0b8437bb70fe54bb99 /set-pwd.sh | |
| parent | 19218d758d4fc0f8f5db5a97eb9dcfdb5086f844 (diff) | |
| download | mlos-master.tar.gz mlos-master.tar.zst mlos-master.zip | |
Diffstat (limited to 'set-pwd.sh')
| -rwxr-xr-x | set-pwd.sh | 7 |
1 files changed, 4 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 |
