{
curl,
netlify-cli,
runCommand,
}:
runCommand "netlify-cli-test" {
nativeBuildInputs = [
netlify-cli
curl
];
meta.timeout = 600;
} ''
mkdir home
export HOME=$PWD/home
# Create a simple site
echo '
hi
' >index.html
echo '/with-redirect /' >_redirects
# Start a local server and wait for it to respond
netlify dev --offline --port 8888 2>&1 | tee log &
sleep 0.1 || true
for (( i=0; i<300; i++ )); do
if grep --ignore-case 'Server now ready' hi'
# Success
touch $out
''