Closed dalin- closed 1 year ago
@dalin- I keep getting /pantheon-tools/pantheon-db-cli: line 45: mysql: command not found
when running pantheon-db-cli eam-d8 live
pantheon-db-dump columbia-sps test | gzip > columbia-sps.mysql.gzip
worked great!
@cbfannin
That suggests that on your local machine you have the application mysqldump
, but not mysql
. Is that correct? If so, any idea how? We might add checks at the top of these files to confirm that you have the required application installed, but that should be a different PR.
@dalin- That probably explains my errors. I actually don't have mysql
or mysqldump
installed on my local machine. I've not had to do anything outside of lando for several months so haven't installed it.
On a Drupal build script I created at my previous employer my co-worker did a basic loop that checked multiple applications to see if they were installed. Maybe something like this will work?
# Functions
isInstalled() {
# check if command exists and fail otherwise
command -v "$1" >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "${white}${red} $1 is not installed. ${reset}${white}${red}"
exit 1
fi
}
echo "${white}${blue} Checking Prerequisites... ${reset}${white}${blue}"
# Check for required Applications.
for app in "php" "composer" "git" "docker" "lando" "curl"; do
isInstalled "${app}"
done
@cbfannin Yes. Something like that. Not sure if the loop is overkill since we only need to check for one application. But let's do that as a separate PR.
Running commands like
Will now work.