Skip to content

Allow arbitrary command (via child process?) #87

@sadams

Description

@sadams

I currently use wait-on for http but have to write something separate for other cases.

E.g. because mysql listens on it's port even when it's not ready to accept connections, i do something like this:

#!/usr/bin/env bash

set -e
i=0
while ! mysqladmin ping -h"$DB_HOST" --silent; do
	i=$((i+1))
	if [[ "$i" -gt '20' ]]; then
		echo "mysql failed to start"
		exit 1
	fi
	sleep 1
done

npx wait-on http://somehttpcheck 

But if wait-on supported a command resource i could do this:

npx wait-on http://somehttpcheck "command:mysqladmin ping -h$DB_HOST"

I'm not sure command is the right naming but hopefully the intention is clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions