Commit b419f598 authored by Sean's avatar Sean 🎨

Add full prebuild script

parent 3940bc9b
#!/bin/sh
#!/bin/bash
echo "Ahoy!"
# Run a restore to be sure we have all the dlls on the system.
dotnet restore web > /dev/null
# Find nuget's global directory
nugetRootPath=$(dotnet nuget locals global-packages -l | cut -d' ' -f4)
nugetRootPath="${nugetRootPath%?}"
# array of ${nameOfDep}|${pathToDllFolder}
packagesAndPaths=("System.Runtime.CompilerServices.Unsafe|4.6.0/lib/netstandard2.0")
mkdir -p lib
for i in "${packagesAndPaths[@]}"
do
# all these vars split out for clarity
name=$(echo "$i" | cut -d'|' -f1)
path=$(echo "$i" | cut -d'|' -f2)
nugetDll="$name.dll"
pathFromNugetRoot="$(echo "$name" | awk '{print tolower($0)}')/$path"
fullPath="$nugetRootPath/$pathFromNugetRoot/$nugetDll"
cp "$fullPath" "./lib/$nugetDll"
echo " > Copied $nugetDll into lib for type provider."
done
......@@ -7,11 +7,16 @@
</PropertyGroup>
<Target Name="TypeProviderSetup" BeforeTargets="Build">
<Exec Command="./prebuild.sh"/>
<Exec Command="./prebuild.sh" />
</Target>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Npgsql" Version="4.1.3" />
<PackageReference Include="SQLProvider" Version="1.1.76" />
</ItemGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment