0

I have created a brew formulae for one of my github repos. Now I want run 2 bash scripts that are present in the project.

My formulae looks likes this :

class UnifaiCore < Formula

  @@branch_name = "brew-installer"
  desc ""
  homepage "homepage_url"
  url "project_url",
    :branch => @@branch_name
  version "v0.1.0"
  license ""

  def install()
   puts "inside install"
   puts %x(whoami)


   venv_setup_script = "unifai-core-venv-setup.sh"
   installer_script = "unifai-core-installer.sh"

   bin.install venv_setup_script
   exec("#{prefix}/bin/#{venv_setup_script}")


   bin.install installer_script
   exec("#{prefix}/bin/#{installer_script}")

   # I have also tried system, %x() to run these bash scripts, have also tried adding source in front.

  end

end

Now when ever I am trying to run this using brew install command. I am getting permission denied error.

Error: An exception occurred within a child process: Errno::EACCES: Permission denied - /usr/local/Cellar/unifai-core/v0.1.0/bin/unifai-core-venv-setup.sh

I have tried following things till now :

  1. How to fix homebrew permissions?
  2. giving chmod 775 to the folder
  3. I also checked which user it's using to execute the scripts but printing whoami. It's the same user that I have used to run these bash scripts in my terminal.
vaibhav
  • 45
  • 6

0 Answers0