testdouble / scripty

Because no one should be shell-scripting inside a JSON file.
MIT License
963 stars 23 forks source link

Spawn another lifecycle event #57

Closed texastoland closed 6 years ago

texastoland commented 6 years ago

I previously had prebuild: yarn test but I need to avoid {pre,post}* hooks. My new build script is:

#!/bin/bash
set -eu
runner=${npm_config_user_agent%%/*} # npm or yarn
$runner run test                    # or scripty test
parcel build src/index.html

Is there a simpler way to do what I want? Ideally I'd rather write scripty test and be done with it. Do you see any reason it wouldn't make sense to allow the lifecycle event to be overriden in a child script? Or better to consider #35 (ordered scripts) or #43 (set runner in a before hook)?

searls commented 6 years ago

I'm honestly open to both #35 & #43, I just haven't been using/maintaining scripty much. I'm unsure what other prescription you're intimating above, but if you can explain that I'm happy to consider it (I see you opened some other issues but this is the first I'm looking at)

texastoland commented 6 years ago

I'll PR today separate from #35 and #58. I want to change the CLI to allow scripty test SCRIPTY_TARGET=test scripty if and only if Scripty is already running. Then you can delegate to another script without npm/yarn run.