Skip to content

Commit 965c78c

Browse files
authored
Fix use of a simple directory name with build-source-tarball.sh (#2140)
Running ./build-source-tarball.sh dotnet-v3.1.114-SDK-original Leads to source-build trying to use source-build/packages/restored/microsoft.dotnet.arcade.sdk/1.0.0-beta.20113.5/tools/dotnet-v3.1.114-SDK-original instead of a top-level dotnet-v3.1.114-SDK-original directory. Fix that. Fixes: #2130
1 parent dfe2fbe commit 965c78c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build-source-tarball.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ usage() {
1414
echo "use -- to send the remaining arguments to build.sh"
1515
}
1616

17+
getrealpath()
18+
{
19+
if command -v realpath > /dev/null; then
20+
realpath $1
21+
else
22+
readlink -f $1
23+
fi
24+
}
25+
1726
if [ -z "${1:-}" ]; then
1827
usage
1928
exit 1
@@ -117,7 +126,7 @@ while [[ -h $fullTarballRoot ]]; do
117126
# symlink file was located
118127
[[ $fullTarballRoot != /* ]] && fullTarballRoot="$SCRIPT_ROOT/$fullTarballRoot"
119128
done
120-
export FULL_TARBALL_ROOT="$fullTarballRoot"
129+
export FULL_TARBALL_ROOT="$(getrealpath "$fullTarballRoot")"
121130

122131
if [ -e "$TARBALL_ROOT" ]; then
123132
echo "info: '$TARBALL_ROOT' already exists"

0 commit comments

Comments
 (0)