Running "pod install" in automator action in Mac OS - Permission denied - bash

I am currently grading approx 50 apps created by students whereas most of them use CocoaPods in their projects and I'm spending an awful lot of time just navigating in the terminal to different folders just to run "pod install". I googled a bit and found this page:
https://medium.com/#abhishekbedi/podfile-right-click-pod-install-5da88c89c907
Which is exactly what I want, but of course it doesn't work on my computer. I am not proficient in Terminal at all and I can't figure out what I'm missing, any help much appreciated!
Here's what I have in the automator action right now:
#!/bin/bash
file=$1
POD="/usr/local/bin/pod"
folder=dirname $file
cd $folder
LANG=en_US.UTF-8 $POD install
, which results in the following error:
Task ”Run command script” encountered an error: ”-: line 3: /Users/.../Podfile: Permission denied”
Maybe I got the text a bit wrong, I just translated it from Swedish.
I've tried chmod on /usr/local/bin/pod and both the file and folders (probably shouldn't have done that), but the error just got worse.
I want all necessary handling inside the script, since any terminal action would defeat the purpose of not having to use the terminal..
Ideas? Thanks

Related

Trying to run a Unix-exec file via MacOS Terminal results in "zsh: exec format error"

I'm on MacOS BigSur 11.4. I'm trying to run an executable file to start a Minecraft server from a folder of set up files associated with a Minecraft/Python coding book (https://nostarch.com/programwithminecraft).
My order of operations has been. 1) I moved to the file's path via cd/, 2) set the file's executable bit via: chmod +x ./NAME_OF_THE_FILE, and 3) try running the following command to execute the file: ./NAME_OF_THE_FILE
Another post advised that once I run those commands, going forward I just need to run the third command while in the files path. However, no matter how many things I try to I keep getting a "zsh: exec format error."
I suspect this has something to do with the book's publication being in 2015 when the current version of MacOS was Mountain Lion, which was before they switched from bash to zsh with all releases successive to Catalina. This would suggest I'm just formatting something wrong in a way that conflicts with the zsh syntax, but I can't figure it out. I'm searching around zsh format error related posts and they all discuss actions and conflicts that seem only tangentially related to my issue. Any help appreciated.
Thank you

-Bash Shell Script "No such file or directory"

Pretty new to coding and I am running into an error I've never seen before and would really appreciate any help navigating this :( Thank you!
I wanted to delete nvm, so I removed the folder following the advice given on StackOverflow. That FINALLY successfully deleted node from my mac (wanted to uninstall because I was running into dependency errors). The I used brew install to reinstall node. I can find the path to the node file (using which node). However when I run node -v I get the following bash (shell script??) error: -bash: /Users/Cindy/.nvm/versions/node/v12.14.1/bin/node: No such file or directory
I also followed #1219 and went into my bash_profile to delete the lines related to nvm. Now I don't know how to move forward with this.
I just want to be able to download node and run it properly to prepare for an interview in React and JS but I ran into these nasty bugs instead and morale is low. I'm lost now and I'm not sure if I just completely ruined my computer.

Mac app Packages - Running pre-installation script issues

So I'm using the packages app : http://s.sudre.free.fr/Software/Packages/about.html
Running a pre-installation script for my package that does something simple such as
#!/bin/sh
cd ~/Desktop
mkdir test_folder
exit 0
Gives me no issues, creates the folder and installation is successful. (It is a dummy app/package and I am only testing to make sure I can get the installation script to work).
However, when I try to test the actual content I want to install for the user, it says the installation is successful but nothing happens.
#!/bin/sh
export GOPATH=~/gocode
export PATH=$PATH:$GOPATH/bin
go get -d github.com/lightningnetwork/lnd
cd $GOPATH/src/github.com/lightningnetwork/lnd
make && make install
exit 0
I'm not sure if my script is incorrect? Do I have to use only native bash commands because I am aware that go & get aren't traditional bash commands. I'm really confused because this script works 100% fine when running normally & as admin through the terminal yet gives me issues when using the Packages App.
I'm totally open to achieving this installation a different way (not using Packages or having to do a different script approach).
An alternative I was thinking was to create an Electron Menu Bar app that would run the same script, but I'm not sure if this would work either.
Thank you so much for your help!

NIST fingerprint software terminal issue with Mac

I have been trying to get the NIST Biometric Image Software downloaded and running on a mac as I saw it would be easier than doing it on windows. I have it downloaded and have been trying to use the terminal to set it up, but it keeps saying it is unable to find it in the directory. I haven't worked with terminals much or anything of this magnitude. The input I am putting into the terminal is:
sh setup.sh <FINAL INSTALLATION DIR> [--without-X11]
With the final installation dir being the one I copied from the path where it is located. I am not sure if anyone has worked with this before, or had any similar issues to the one I have above. Any help would be greatly appreciated as I am kind of lost on this.
Open terminal then cd /Path /to/where/your/NISTsoftware/directory/is
Afterwards give it execute permussions by running this on terminal chmod 755 setup.sh
Then execute it so that you can install your NIST software by running ./setup.sh

Basic terminal commands not working after trying to install Composer

My mac terminal is completely dysfunctional! Every time I open terminal I get this message:
-bash: export: `/Applications/MAMP/bin/php/php5.5.10/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin': not a valid identifier
The problem came about a while ago, I believe I was attempting to install composer to work with MAMP.
Today I started a beginner tutorial on how to use the Terminal and almost every command does not work such as the basic mkdir , ls , and touch (to make folder, list items, and make a file respectively), (screenshot attached).
I have already tried deleting the ~/Library/Preferences/com.apple.Terminal.plist file. Your help is greatly appreciated.
I am working with Mac OS X 10.10.2
screenshot of terminal after making basic commands
It looks like you have an error in your .bash_profile or other startup script. Open it on terminal using vi ~/.bash_profile or some other editor of your choice and comment out that line, then type source .bash_profile to reload it.

Resources