Skip to content

Commit

Permalink
Solve issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Oct 28, 2024
1 parent e7886bd commit 4dba003
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ uncompress() {

success "Tarball uncompressed successfully."

# Add links for certificates
# In Linux, add links for certificates
if [ "${PLATFORM_OS}" = "linux" ]; then
local openssl_base="${PLATFORM_PREFIX}/store/`ls ${PLATFORM_PREFIX}/store/ | grep openssl | head -n 1`/share"
local openssl_dir="${openssl_base}/`ls ${openssl_base} | grep openssl`"
Expand All @@ -445,6 +445,23 @@ uncompress() {
# Store the certificate links in the install list
echo "${openssl_cert_dir}" | ${CMD_SUDO} tee -a "${install_list}" > /dev/null
echo "${openssl_cert_file}" | ${CMD_SUDO} tee -a "${install_list}" > /dev/null

# In MacOS, create a binary list for allowing 'metacall npm ...' and other commands
elif [ "${PLATFORM_OS}" = "macos" ]; then
local bin_list="${share_dir}/metacall-binary-install-bin.txt"

# Get the binary files installed, use the tar directly because if we use the ${install_list} it is
# going to exclude the binaries that were already installed, also do not include metacall itself
${CMD_SUDO} tar -tf "${tmp}" | sed 's/^\.//' \
| grep "^${PLATFORM_BIN}/" \
| grep -v "^${PLATFORM_BIN}/metacall" \
| ${CMD_SUDO} tee "${bin_list}" > /dev/null

# Give read write permissions for all
${CMD_SUDO} chmod 666 "${bin_list}"

# Add the bin list to the install list, this helper file will allow to handle package managers from metacall
echo "${bin_list}" | ${CMD_SUDO} tee -a "${install_list}" > /dev/null
fi

# Clean the tarball
Expand Down Expand Up @@ -507,16 +524,7 @@ cli() {
local install_list="${share_dir}/metacall-binary-install.txt"
local bin_list="${share_dir}/metacall-binary-install-bin.txt"

# Get the binary files installed (do not include metacall itself)
${CMD_SUDO} grep "^${PLATFORM_BIN}/" "${install_list}" | grep -v "^${PLATFORM_BIN}/metacall" | ${CMD_SUDO} tee "${bin_list}" > /dev/null

# Give read write permissions for all
${CMD_SUDO} chmod 666 "${bin_list}"

# Add the bin list to the install list, this helper file will allow to handle package managers from metacall
echo "${bin_list}" | ${CMD_SUDO} tee -a "${install_list}" > /dev/null

# Remove last line of the script
# Remove last line of the shell script for the CLI
${CMD_SUDO} sed -i '' -e '$d' "${PLATFORM_BIN}/metacall"

# Set up command line
Expand Down Expand Up @@ -856,7 +864,7 @@ main() {
# Run docker install
docker_install
else
# TODO: Remember to do MacOs install fallback to brew in order to compile metacall
# TODO: Remember to do MacOS install fallback to brew in order to compile metacall
# spctl --status

# Run binary install
Expand Down

0 comments on commit 4dba003

Please sign in to comment.