@@ -34,7 +34,7 @@ async function downloadSchema(releaseTag, githubToken) {
34
34
console . log ( `Downloaded schema for ${ releaseTag } ` ) ;
35
35
}
36
36
37
- async function downloadAsset ( platform , os , arch , releaseTag , githubToken ) {
37
+ async function downloadAsset ( platform , arch , os , releaseTag , githubToken ) {
38
38
const buildName = getBuildName ( platform , arch ) ;
39
39
const assetUrl = `https://github.com/supabase-community/postgres_lsp/releases/download/${ releaseTag } /${ buildName } ` ;
40
40
@@ -50,7 +50,7 @@ async function downloadAsset(platform, os, arch, releaseTag, githubToken) {
50
50
}
51
51
52
52
// just download to root.
53
- const fileStream = fs . createWriteStream ( getBinarySource ( os , platform , arch ) ) ;
53
+ const fileStream = fs . createWriteStream ( getBinarySource ( platform , arch , os ) ) ;
54
54
55
55
await streamPipeline ( response . body , fileStream ) ;
56
56
@@ -65,7 +65,7 @@ function getBinaryExt(os) {
65
65
return os === "windows" ? ".exe" : "" ;
66
66
}
67
67
68
- function getBinarySource ( os , platform , arch ) {
68
+ function getBinarySource ( platform , arch , os ) {
69
69
const ext = getBinaryExt ( os ) ;
70
70
return resolve ( PGLT_ROOT , `${ getBuildName ( platform , arch ) } ${ ext } ` ) ;
71
71
}
@@ -123,7 +123,7 @@ function copyBinaryToNativePackage(platform, arch, os) {
123
123
fs . writeFileSync ( manifestPath , manifest ) ;
124
124
125
125
// Copy the CLI binary
126
- const binarySource = getBinarySource ( os , platform , arch ) ;
126
+ const binarySource = getBinarySource ( platform , arch , os ) ;
127
127
const ext = getBinaryExt ( os ) ;
128
128
const binaryTarget = resolve ( packageRoot , `pglt${ ext } ` ) ;
129
129
@@ -169,9 +169,10 @@ function copySchemaToNativePackage(platform, arch) {
169
169
const ARCHITECTURES = [ "x86_64" , "aarch64" ] ;
170
170
171
171
for ( const platform of PLATFORMS ) {
172
+ const os = getOs ( platform ) ;
173
+
172
174
for ( const arch of ARCHITECTURES ) {
173
- const os = getOs ( platform ) ;
174
- await downloadAsset ( platform , os , arch , releaseTag , githubToken ) ;
175
+ await downloadAsset ( platform , arch , os , releaseTag , githubToken ) ;
175
176
copyBinaryToNativePackage ( platform , arch , os ) ;
176
177
copySchemaToNativePackage ( platform , arch ) ;
177
178
}
0 commit comments