jeffbski / jeffbski/wait-on

Allow arbitrary command (via child process?)

Open
#87 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
87
PR merge metrics
No merged PRs in 30d

Description

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:
```shell
#!/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:

```shell
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.