Fix shell if/else for npm test/publish

Fix 0cc83d850386f391c8565c14d5e53b0ff696b9f7