@@ -24,6 +24,10 @@ const PLATFORM_MAPPING = {
2424} ;
2525
2626function validateConfiguration ( packageJson ) {
27+ if ( ! packageJson . name ) {
28+ return "'name' property must be specified" ;
29+ }
30+
2731 if ( ! packageJson . version ) {
2832 return "'version' property must be specified" ;
2933 }
@@ -59,6 +63,7 @@ async function parsePackageJson() {
5963 }
6064
6165 // We have validated the config. It exists in all its glory
66+ const pkgName = packageJson . name . toString ( ) ;
6267 const bin = packageJson . bin . toString ( ) ;
6368 const binName = path . basename ( bin ) ;
6469 const binPath = path . dirname ( bin ) ;
@@ -74,7 +79,7 @@ async function parsePackageJson() {
7479 url = url . replace ( / { { version} } / g, version ) ;
7580 url = url . replace ( / { { bin_ n a m e } } / g, binName ) ;
7681
77- return { binName, binPath, url, version } ;
82+ return { pkgName , binName, binPath, url, version } ;
7883}
7984
8085const errGlobal = `Installing Supabase CLI as a global module is not supported.
@@ -118,9 +123,9 @@ async function main() {
118123
119124 // Copy binary because yarn runs as postinstall
120125 if ( process . env . npm_config_user_agent . startsWith ( "yarn/" ) ) {
121- const bin = path . join ( opts . binPath , opts . binName ) ;
122- const link = path . join ( ".." , ".bin" , opts . binName ) ;
123- await fs . promises . symlink ( bin , link ) ;
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 ) ;
124129 }
125130
126131 // TODO: verify checksums
0 commit comments