-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Add support for --before/--then/--else flags #410
Comments
Yeah this sounds reasonable! Though I'd be curious about your specific usecase, to see if we can provide some specific integration before opening up to the full |
It's a very project specific workflow where we need to run a script over the generated JS to fix up some internal require paths based on the build output. To be honest I have not used It's not a super urgent feature request by any means because it's really just been a workflow enhancement. That said, if you do think it's a worth while feature to bring in (in terms of maintenance cost going forward,) I'd be happy to take a stab at it. |
I used the
It was quite handy as I didn't have to swap to the terminal to check to see when everything was ready to refresh the browser. Would love to see this go into Spago. |
Yeah this sounds good, let's go with the way |
I wonder if we can achieve the same thing in a more composable manner. Imagine spago only reporting to stderr during Imagine some structured output like this:
it would be trivial to do sth like:
Then again, that precludes spago from cancelling long-running post-build commands. |
@felixSchl yeah this is also a very interesting approach. Note that starting with #475 logging is starting to move to |
* Add support for `--before`, `--then` and `--else` flags Fix #410 * Fix before, then, else specs for Windows. It looks like the space following echo is included in Windows which was breaking the tests. * Update README to use a notification example for the before command. Duplicating the already existing clear-screen flag is redundant. * If a command fails, it should halt and fail the build. * The `then` command should run after postbuild. This would make it run after the bundling process so any postprocessing on the final bundle can be done.
Pulp has a handful of very useful options to run a command when compilation starts, fails, and succeeds:
--before <string>
,--else <string>
, and--then <string>
, respectively. This is useful in combination with--watch
in order to, for example, run some post-processing script on the output. Currently the only way to achieve the same is using an external file watcher and runspago build && foobar
on every file change. Aside from the additional overhead of getting set up properly for every project, there's also the overhead of cold-starting a build every time (see also: #409, #110) which slows down rebuilds considerably.The text was updated successfully, but these errors were encountered: