supabase 1.18.1 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/preinstall.js +9 -4
package/package.json
CHANGED
package/scripts/preinstall.js
CHANGED
|
@@ -24,6 +24,10 @@ const PLATFORM_MAPPING = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
function validateConfiguration(packageJson) {
|
|
27
|
+
if (!packageJson.name) {
|
|
28
|
+
return "'name' property must be specified";
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
if (!packageJson.version) {
|
|
28
32
|
return "'version' property must be specified";
|
|
29
33
|
}
|
|
@@ -59,6 +63,7 @@ async function parsePackageJson() {
|
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
// We have validated the config. It exists in all its glory
|
|
66
|
+
const pkgName = packageJson.name.toString();
|
|
62
67
|
const bin = packageJson.bin.toString();
|
|
63
68
|
const binName = path.basename(bin);
|
|
64
69
|
const binPath = path.dirname(bin);
|
|
@@ -74,7 +79,7 @@ async function parsePackageJson() {
|
|
|
74
79
|
url = url.replace(/{{version}}/g, version);
|
|
75
80
|
url = url.replace(/{{bin_name}}/g, binName);
|
|
76
81
|
|
|
77
|
-
return { binName, binPath, url, version };
|
|
82
|
+
return { pkgName, binName, binPath, url, version };
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
const errGlobal = `Installing Supabase CLI as a global module is not supported.
|
|
@@ -118,9 +123,9 @@ async function main() {
|
|
|
118
123
|
|
|
119
124
|
// Copy binary because yarn runs as postinstall
|
|
120
125
|
if (process.env.npm_config_user_agent.startsWith("yarn/")) {
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
await fs.promises.symlink(
|
|
126
|
+
const src = path.join("..", opts.pkgName, opts.binPath, opts.binName);
|
|
127
|
+
const dst = path.join("..", ".bin", opts.binName);
|
|
128
|
+
await fs.promises.symlink(src, dst);
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
// TODO: verify checksums
|