buildDotnetModule: do not run dotnet command using env

There should be no reason to use env here:

1. In places where it is used to run dotnet with environment variables,
   the same can be done with shell syntax.

   For example, `env "FOO=$bar" baz` is equivalent to `FOO="$bar" baz`.

2. Otherwise, it just unnecessarily forces PATH lookup for dotnet
   command. In addition to that, some dotnet invocations did not use
   env.
This commit is contained in:
Ivan Trubach 2024-01-09 10:29:38 +03:00
parent 454d208c02
commit 7877140075
4 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ dotnetBuildHook() {
runtimeIdFlags+=("--runtime @runtimeId@")
fi
env dotnet build ${project-} \
dotnet build ${project-} \
-maxcpucount:$maxCpuFlag \
-p:BuildInParallel=$parallelBuildFlag \
-p:ContinuousIntegrationBuild=true \

View File

@ -22,7 +22,7 @@ dotnetCheckHook() {
runtimeIdFlags=("--runtime @runtimeId@")
fi
env "LD_LIBRARY_PATH=@libraryPath@" \
LD_LIBRARY_PATH="@libraryPath@" \
dotnet test "$project" \
-maxcpucount:$maxCpuFlag \
-p:ContinuousIntegrationBuild=true \

View File

@ -15,7 +15,7 @@ dotnetConfigureHook() {
dotnetRestore() {
local -r project="${1-}"
env dotnet restore ${project-} \
dotnet restore ${project-} \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--runtime "@runtimeId@" \
@ -43,7 +43,7 @@ EOF
find -name paket.dependencies -exec sed -i 's+source .*+source @nugetSource@/lib+g' {} \;
find -name paket.lock -exec sed -i 's+remote:.*+remote: @nugetSource@/lib+g' {} \;
env dotnet tool restore --add-source "@nugetSource@/lib"
dotnet tool restore --add-source "@nugetSource@/lib"
(( "${#projectFile[@]}" == 0 )) && dotnetRestore

View File

@ -27,7 +27,7 @@ dotnetInstallHook() {
runtimeIdFlags+=("--runtime @runtimeId@")
fi
env dotnet publish ${project-} \
dotnet publish ${project-} \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--output "${installPath-$out/lib/$pname}" \
@ -40,7 +40,7 @@ dotnetInstallHook() {
dotnetPack() {
local -r project="${1-}"
env dotnet pack ${project-} \
dotnet pack ${project-} \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--output "$out/share" \