@@ -6789,35 +6789,31 @@ const urls = {
67896789// }
67906790// }
67916791
6792- async function downloadCLI ( osPlatform ) {
6792+ async function downloadCLI ( osPlatform ) {
67936793 try {
6794-
6795- core . info ( `downloading stackql binary for ${ osPlatform } ` ) ;
6796- // const url = urls[osPlatform];
6797- // core.debug(`binary location: ${url}`);
6794+ core . info ( `Preparing to download/install stackql for ${ osPlatform } ` ) ;
67986795
67996796 switch ( osPlatform ) {
68006797 case 'win32' :
68016798 return await tc . extractZip ( await tc . downloadTool ( urls [ osPlatform ] ) ) ;
68026799 case 'darwin' :
6803- core . info ( `installing stackql using Homebrew` ) ;
6800+ core . info ( `Installing stackql using Homebrew` ) ;
68046801 execSync ( 'brew install stackql' , { stdio : 'inherit' } ) ;
6805- // Assuming stackql installs to a standard location accessible in the PATH
6806- // No need to return a path since brew handles placing it in the PATH
6807- return '/usr/local/bin' ; // or wherever brew installs binaries
6802+ // Find the installation path using which
6803+ const stackqlPath = execSync ( 'which stackql' , { encoding : 'utf-8' } ) . trim ( ) ;
6804+ core . debug ( `Stackql installed at: ${ stackqlPath } ` ) ;
6805+ return path . dirname ( stackqlPath ) ; // Return the directory of the binary
68086806 case 'linux' :
68096807 return await tc . extractZip ( await tc . downloadTool ( urls [ osPlatform ] ) ) ;
68106808 default :
68116809 throw new Error ( `Unsupported platform: ${ osPlatform } ` ) ;
68126810 }
6813-
68146811 } catch ( error ) {
6815- core . error ( error ) ;
6812+ core . error ( `Failed to install Stackql: ${ error } ` ) ;
68166813 throw error ;
68176814 }
68186815}
68196816
6820-
68216817async function makeExecutable ( cliPath , osPlatform ) {
68226818 try {
68236819 if ( osPlatform === 'win32' ) {
@@ -6880,13 +6876,13 @@ async function setup() {
68806876 core . debug ( `path to cli: ${ cliPath } ` ) ;
68816877
68826878 // set perms and make executable
6883- core . debug ( `updating permissions for ${ cliPath } ` ) ;
6884- fs . chmodSync ( cliPath , '777' ) ;
6885-
6886- core . debug ( `adding ${ cliPath } to the path` ) ;
6887- core . addPath ( cliPath )
6888-
6889- await makeExecutable ( cliPath , osPlatform )
6879+ if ( osPlatform != 'darwin' ) {
6880+ core . debug ( `updating permissions for ${ cliPath } ` ) ;
6881+ fs . chmodSync ( cliPath , '777' ) ;
6882+ core . debug ( `adding ${ cliPath } to the path` ) ;
6883+ core . addPath ( cliPath )
6884+ await makeExecutable ( cliPath , osPlatform )
6885+ }
68906886
68916887 const wrapper = core . getInput ( 'use_wrapper' ) === 'true' ;
68926888
0 commit comments