File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 19
19
buildPgrxExtension_0_11_3 rec {
20
20
pname = "supabase-wrappers" ;
21
21
version = "0.4.1" ;
22
+ # update this when the wrappers version is updated
23
+ # required to ensure that extensions update scripts from previous versions are generated
24
+ previousVersions = [ "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0" ] ;
22
25
inherit postgresql ;
23
26
src = fetchFromGitHub {
24
27
owner = "supabase" ;
@@ -62,7 +65,7 @@ buildPgrxExtension_0_11_3 rec {
62
65
63
66
preBuild = ''
64
67
echo "Processing git tags..."
65
- echo '${ builtins . toJSON gitTags } ' | ${ jq } /bin/jq -r '.[].name' | sort -rV > git_tags.txt
68
+ echo '${ concatStringsSep "," previousVersions } ' | sed 's/,/\n/g' > git_tags.txt
66
69
'' ;
67
70
68
71
postInstall = ''
@@ -71,10 +74,9 @@ buildPgrxExtension_0_11_3 rec {
71
74
sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql"
72
75
73
76
if [ -f "$sql_file" ]; then
74
- while read -r tag; do
75
- tag_version=$(echo "$tag" | sed 's/^v//')
76
- if [ "$(printf '%s\n' "$tag_version" "$current_version" | sort -V | head -n1)" = "$tag_version" ] && [ "$tag_version" != "$current_version" ]; then
77
- new_file="$out/share/postgresql/extension/wrappers--$tag_version--$current_version.sql"
77
+ while read -r previous_version; do
78
+ if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then
79
+ new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql"
78
80
echo "Creating $new_file"
79
81
cp "$sql_file" "$new_file"
80
82
fi
You can’t perform that action at this time.
0 commit comments