Skip to content

Commit eccac1d

Browse files
committed
otp_build: Refuse if current directory is not under ERL_TOP
1 parent f7b5667 commit eccac1d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

otp_build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ check_erltop ()
137137
echo "The environment variable ERL_TOP must be set." >&2
138138
exit 1
139139
fi
140+
else
141+
real_ERL_TOP=`realpath $ERL_TOP`
142+
real_PWD=`realpath $PWD`
143+
if [ "X${real_PWD##$real_ERL_TOP*}" != "X" ]; then
144+
echo "Current working directory is not in ERL_TOP." >&2
145+
echo "ERL_TOP=$ERL_TOP" >&2
146+
echo "PWD=$PWD" >&2
147+
exit 1
148+
fi
140149
fi
141150
}
142151

0 commit comments

Comments
 (0)