Skip to content
Snippets Groups Projects
Verified Commit 6f0a15c3 authored by hashworks's avatar hashworks
Browse files

Fix unexpected script_path behaviour

When one calls the `build.sh` scripts with bash instead of the shebang
`$script_path` contains the filepath, not the parent dir:

```
% cd /path
% grep -A2 script_path= build.sh
script_path=$(readlink -f "${0%/*}")
echo "$script_path"
exit 0
% ./build.sh
/path
% bash build.sh
/path/build.sh
```

This commit fixes that:

```
% grep -A2 script_path= build.sh
script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )"
echo "$script_path"
exit 0
% ./build.sh
/path
% bash build.sh
/path
```
parent 7acea696
No related branches found
No related tags found
1 merge request!43Fix unexpected script_path behaviour
Pipeline #468 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment