makeWrapper: search for free unwrapped file name

This commit is contained in:
Nikolay Amiantov 2017-04-12 18:12:16 +03:00
parent 8c56608078
commit e7c76d3c25

View File

@ -132,6 +132,9 @@ wrapProgram() {
local prog="$1"
local hidden
hidden="$(dirname "$prog")/.$(basename "$prog")"-wrapped
while [ -e "$hidden" ]; do
hidden="${hidden}_"
done
mv "$prog" "$hidden"
# Silence warning about unexpanded $0:
# shellcheck disable=SC2016