mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 21:06:41 +00:00
Merge branch 'dont-leak-bash-settings' into 'master'
Don't leak bash settings from activate_msvc.sh See merge request OpenMW/openmw!288
This commit is contained in:
commit
b4ac1e1498
1 changed files with 16 additions and 2 deletions
|
@ -1,6 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
oldSettings=$-
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
function restoreOldSettings {
|
||||||
|
if [[ $oldSettings != *e* ]]; then
|
||||||
|
set +e
|
||||||
|
fi
|
||||||
|
if [[ $oldSettings != *u* ]]; then
|
||||||
|
set +u
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||||
echo "Error: Script not sourced."
|
echo "Error: Script not sourced."
|
||||||
|
@ -8,6 +18,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||||
echo "source ./activate_msvc.sh"
|
echo "source ./activate_msvc.sh"
|
||||||
echo "or"
|
echo "or"
|
||||||
echo ". ./activate_msvc.sh"
|
echo ". ./activate_msvc.sh"
|
||||||
|
restoreOldSettings
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -78,7 +89,10 @@ command -v mt >/dev/null 2>&1 || { echo "Error: mt (MS Windows Manifest Tool) mi
|
||||||
|
|
||||||
if [ $MISSINGTOOLS -ne 0 ]; then
|
if [ $MISSINGTOOLS -ne 0 ]; then
|
||||||
echo "Some build tools were unavailable after activating MSVC in the shell. It's likely that your Visual Studio $MSVC_DISPLAY_YEAR installation needs repairing."
|
echo "Some build tools were unavailable after activating MSVC in the shell. It's likely that your Visual Studio $MSVC_DISPLAY_YEAR installation needs repairing."
|
||||||
|
restoreOldSettings
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IFS="$originalIFS"
|
IFS="$originalIFS"
|
||||||
|
|
||||||
|
restoreOldSettings
|
Loading…
Reference in a new issue