def _setup(download_dir, platform, showprogress=True):
print('installing stackql...')
try:
binary_name = _get_binary_name(platform)
url = _get_url(platform)
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
archive_file_name = os.path.join(download_dir, os.path.basename(url))
_download_file(url, archive_file_name, showprogress)
if platform == 'Darwin':
os.system('sudo installer -pkg {} -target /'.format(archive_file_name))
else:
with zipfile.ZipFile(archive_file_name, 'r') as zip_ref:
zip_ref.extractall(download_dir)
os.chmod(os.path.join(download_dir, binary_name), 0o755)
except Exception as e:
print("ERROR: [_setup] %s" % (str(e)))
exit()
case 'darwin':
let tmpPath = await tc.downloadTool(url);
core.info(`extracting mac pkg in ${tmpPath}...`);
const installPath = '/Users/runner/work/_temp/stackql-pkg';
execSync(`pkgutil --expand-full ${tmpPath} ${installPath}`);
return `${installPath}/Payload`;
Examine the code here
sudo installer -pkg {} -target /will install the package to a different directory than download directoryos.chmod(os.path.join(download_dir, binary_name), 0o755)will return error