Skip to content

Commit 54f6b46

Browse files
authored
Merge pull request #2 from ldennington/linux-install-fixes
install from source: refactor install location and fix path
2 parents e66805c + 720d347 commit 54f6b46

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/linux/Packaging.Linux/Packaging.Linux.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<PropertyGroup>
1111
<InstallFromSource>false</InstallFromSource>
12-
<InstallLocation>/usr/local</InstallLocation>
12+
<InstallPrefix>/usr/local</InstallPrefix>
1313
</PropertyGroup>
1414

1515
<ItemGroup>
@@ -24,8 +24,8 @@
2424
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
2525

2626
<Target Name="CoreCompile" Condition="'$(OSPlatform)'=='linux'">
27-
<Message Text="$(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version)' --install-location='$(InstallLocation)'" Importance="High" />
28-
<Exec Command="$(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version)' --install-location='$(InstallLocation)'" />
27+
<Message Text="$(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version)' --install-prefix='$(InstallPrefix)'" Importance="High" />
28+
<Exec Command="$(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version)' --install-prefix='$(InstallPrefix)'" />
2929
</Target>
3030

3131
<Target Name="CoreClean">

src/linux/Packaging.Linux/build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ case "$i" in
3030
INSTALL_FROM_SOURCE="${i#*=}"
3131
shift # past argument=value
3232
;;
33-
--install-location=*)
34-
INSTALL_LOCATION="${i#*=}"
33+
--install-prefix=*)
34+
INSTALL_PREFIX="${i#*=}"
3535
shift # past argument=value
3636
;;
3737
*)
@@ -40,9 +40,9 @@ case "$i" in
4040
esac
4141
done
4242

43-
# Ensure install location exists
44-
if [! -d "$installLocation" ]; then
45-
mkdir -p "$INSTALL_LOCATION"
43+
# Ensure install prefix exists
44+
if [! -d "$INSTALL_PREFIX" ]; then
45+
mkdir -p "$INSTALL_PREFIX"
4646
fi
4747

4848
# Perform pre-execution checks
@@ -59,11 +59,11 @@ SYMBOLS="$OUTDIR/payload.sym"
5959
"$INSTALLER_SRC/layout.sh" --configuration="$CONFIGURATION" || exit 1
6060

6161
if [ $INSTALL_FROM_SOURCE = true ]; then
62-
echo "Installing to $INSTALL_LOCATION"
62+
echo "Installing to $INSTALL_PREFIX"
6363

6464
# Install directories
65-
INSTALL_TO="$INSTALL_LOCATION/share/gcm-core/"
66-
LINK_TO="$INSTALL_LOCATION/bin/"
65+
INSTALL_TO="$INSTALL_PREFIX/share/gcm-core/"
66+
LINK_TO="$INSTALL_PREFIX/bin/"
6767

6868
mkdir -p "$INSTALL_TO" "$LINK_TO"
6969

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ for i in "$@"; do
1313
is_ci=true
1414
shift # Past argument=value
1515
;;
16-
--install-location=*)
17-
installLocation="${i#*=}"
16+
--install-prefix=*)
17+
installPrefix="${i#*=}"
1818
shift # past argument=value
1919
;;
2020
esac
2121
done
2222

23-
# If install-location is not passed, use default value
24-
if [ -z "$installLocation" ]; then
25-
installLocation=/usr/local
23+
# If install-prefix is not passed, use default value
24+
if [ -z "$installPrefix" ]; then
25+
installPrefix=/usr/local
2626
fi
2727

28-
# Ensure install location exists
29-
if [! -d "$installLocation" ]; then
30-
echo "The folder $installLocation does not exist"
28+
# Ensure install directory exists
29+
if [! -d "$installPrefix" ]; then
30+
echo "The folder $installPrefix does not exist"
3131
exit
3232
fi
3333

@@ -36,7 +36,7 @@ fi
3636
if [ -z $is_ci ]; then
3737
echo "This script will download, compile, and install Git Credential Manager to:
3838
39-
$installLocation/bin
39+
$installPrefix/bin
4040
4141
Git Credential Manager is licensed under the MIT License: https://aka.ms/gcm/license"
4242

@@ -240,5 +240,5 @@ if [ -z "$DOTNET_ROOT" ]; then
240240
fi
241241

242242
cd "$toplevel_path"
243-
$sudo_cmd env "PATH=$PATH" $DOTNET_ROOT/dotnet build ./src/linux/Packaging.Linux/Packaging.Linux.csproj -c Release -p:InstallFromSource=true -p:InstallLocation=$installLocation
244-
add_to_PATH $installLocation
243+
$sudo_cmd env "PATH=$PATH" $DOTNET_ROOT/dotnet build ./src/linux/Packaging.Linux/Packaging.Linux.csproj -c Release -p:InstallFromSource=true -p:installPrefix=$installPrefix
244+
add_to_PATH "$installPrefix/bin"

0 commit comments

Comments
 (0)