Skip to content

Commit 46d1b3c

Browse files
authored
Merge pull request #685 from easwarh/eahariha/linux-src-build-script
Pass through $PATH to find dotnet
2 parents 6f4986d + 8285e10 commit 46d1b3c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/linux/Packaging.Linux/build.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ else
106106
mkdir -p "$INSTALL_LOCATION"
107107
fi
108108

109+
if [ -z "$DOTNET_ROOT" ]; then
110+
DOTNET_ROOT="$(dirname $(which dotnet))"
111+
fi
112+
109113
# Publish core application executables
110114
echo "Publishing core application..."
111-
dotnet publish "$GCM_SRC" \
115+
$DOTNET_ROOT/dotnet publish "$GCM_SRC" \
112116
--configuration="$CONFIGURATION" \
113117
--framework="$FRAMEWORK" \
114118
--runtime="$RUNTIME" \
@@ -117,7 +121,7 @@ dotnet publish "$GCM_SRC" \
117121
--output="$(make_absolute "$PAYLOAD")" || exit 1
118122

119123
echo "Publishing Bitbucket UI helper..."
120-
dotnet publish "$BITBUCKET_UI_SRC" \
124+
$DOTNET_ROOT/dotnet publish "$BITBUCKET_UI_SRC" \
121125
--configuration="$CONFIGURATION" \
122126
--framework="$FRAMEWORK" \
123127
--runtime="$RUNTIME" \
@@ -126,7 +130,7 @@ dotnet publish "$BITBUCKET_UI_SRC" \
126130
--output="$(make_absolute "$PAYLOAD")" || exit 1
127131

128132
echo "Publishing GitHub UI helper..."
129-
dotnet publish "$GITHUB_UI_SRC" \
133+
$DOTNET_ROOT/dotnet publish "$GITHUB_UI_SRC" \
130134
--configuration="$CONFIGURATION" \
131135
--framework="$FRAMEWORK" \
132136
--runtime="$RUNTIME" \
@@ -135,7 +139,7 @@ dotnet publish "$GITHUB_UI_SRC" \
135139
--output="$(make_absolute "$PAYLOAD")" || exit 1
136140

137141
echo "Publishing GitLab UI helper..."
138-
dotnet publish "$GITLAB_UI_SRC" \
142+
$DOTNET_ROOT/dotnet publish "$GITLAB_UI_SRC" \
139143
--configuration="$CONFIGURATION" \
140144
--framework="$FRAMEWORK" \
141145
--runtime="$RUNTIME" \
@@ -225,4 +229,4 @@ if [ $INSTALL_FROM_SOURCE = false ]; then
225229
dpkg-deb --build "$DEBROOT" "$DEBPKG" || exit 1
226230
fi
227231

228-
echo $MESSAGE
232+
echo $MESSAGE

src/linux/Packaging.Linux/install-from-source.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ if [ "z$script_path" = "z$toplevel_path" ] || [ ! -f "$toplevel_path/Git-Credent
178178
test -d "$toplevel_path" || git clone https://github.com/GitCredentialManager/git-credential-manager
179179
fi
180180

181+
if [ -z "$DOTNET_ROOT" ]; then
182+
DOTNET_ROOT="$(dirname $(which dotnet))"
183+
fi
184+
181185
cd "$toplevel_path"
182-
$sudo_cmd dotnet build ./src/linux/Packaging.Linux/Packaging.Linux.csproj -c Release -p:InstallFromSource=true
183-
add_to_PATH "/usr/local/bin"
186+
$sudo_cmd env "PATH=$PATH" $DOTNET_ROOT/dotnet build ./src/linux/Packaging.Linux/Packaging.Linux.csproj -c Release -p:InstallFromSource=true
187+
add_to_PATH "/usr/local/bin"

0 commit comments

Comments
 (0)