Skip to content

Instantly share code, notes, and snippets.

@wiverson
Created May 11, 2023 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wiverson/45a370ead1919e9f44ad78ec90a9b8c2 to your computer and use it in GitHub Desktop.
Save wiverson/45a370ead1919e9f44ad78ec90a9b8c2 to your computer and use it in GitHub Desktop.
Build script to download both the latest supabase-csharp libs as well as the current source.
#!/bin/bash
rm -rf target
rm -rf nuget
rm -rf unpack
mkdir nuget
mkdir target
mkdir unpack
./bin/nusave-3.1.1-dawrin-x64/nusave cache package "supabase-csharp@0.9.1" --targetFrameworks ".NETStandard@2.0" --cacheDir "nuget"
./bin/nusave-3.1.1-dawrin-x64/nusave cache package "Websocket.Client@4.6.1" --targetFrameworks ".NETStandard@2.0" --cacheDir "nuget"
# Unzip files from "nuget" directory to "unpack" directory
nuget_dir="nuget"
unpack_dir="unpack"
mkdir -p "$unpack_dir"
# Unzip files
for file in "$nuget_dir"/*.nupkg; do
file_name=$(basename "$file" .nupkg)
unzip -qo "$file" -d "$unpack_dir/$file_name"
done
# Set read permissions for all extracted files
find "$unpack_dir" -type f -exec chmod +rw {} \;
# Copy .dll files to target directory
target_dir="target"
mkdir -p "$target_dir"
# Find .dll files recursively in the unpack directory and copy them to the target directory
find "$unpack_dir" -type f -name "*.dll" -exec cp -n {} "$target_dir" \;
degit https://github.com/supabase-community/supabase-csharp/Supabase target/client
degit https://github.com/supabase-community/core-csharp/Core target/core
degit https://github.com/supabase-community/postgrest-csharp/Postgrest target/postgrest
degit https://github.com/supabase-community/gotrue-csharp/Gotrue target/auth
degit https://github.com/supabase-community/realtime-csharp/Realtime target/realtime
degit https://github.com/supabase-community/storage-csharp/Storage target/storage
degit https://github.com/supabase-community/functions-csharp/Functions target/functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment