Changeset View
Changeset View
Standalone View
Standalone View
craftenv.sh
Show All 11 Lines | 10 | if [[ -z "$craftRoot" ]];then | |||
---|---|---|---|---|---|
12 | exit 1 | 12 | exit 1 | ||
13 | fi | 13 | fi | ||
14 | 14 | | |||
15 | if [[ ! -d "$craftRoot" ]]; then | 15 | if [[ ! -d "$craftRoot" ]]; then | ||
16 | craftRoot=$(python3.6 -c "import os; import sys; print(os.path.dirname(os.path.abspath(sys.argv[1])));" "$craftRoot") | 16 | craftRoot=$(python3.6 -c "import os; import sys; print(os.path.dirname(os.path.abspath(sys.argv[1])));" "$craftRoot") | ||
17 | fi | 17 | fi | ||
18 | 18 | | |||
19 | export craftRoot | 19 | export craftRoot | ||
20 | if [ -n "$PS1" ]; then | ||||
21 | export PS1="CRAFT: $PS1" | ||||
22 | fi | ||||
20 | 23 | | |||
21 | CRAFT_ENV=($(python3.6 "$craftRoot/bin/CraftSetupHelper.py" --setup)) | 24 | CRAFT_ENV=($(python3.6 "$craftRoot/bin/CraftSetupHelper.py" --setup)) | ||
22 | # Split the CraftSetupHelper.py output by newlines instead of any whitespace | 25 | # Split the CraftSetupHelper.py output by newlines instead of any whitespace | ||
23 | # to also handled environment variables containing spaces (e.g. $PS1) | 26 | # to also handled environment variables containing spaces (e.g. $PS1) | ||
24 | # See https://stackoverflow.com/q/24628076/894271 | 27 | # See https://stackoverflow.com/q/24628076/894271 | ||
25 | function export_lines() { | 28 | function export_lines() { | ||
26 | local IFS=$'\n' | 29 | local IFS=$'\n' | ||
27 | local lines=($1) | 30 | local lines=($1) | ||
Show All 35 Lines |