Skip to content
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

Add ability to wait for dependency before running prep #82

Open
jrebey opened this issue Dec 31, 2019 · 0 comments
Open

Add ability to wait for dependency before running prep #82

jrebey opened this issue Dec 31, 2019 · 0 comments

Comments

@jrebey
Copy link

jrebey commented Dec 31, 2019

We're using modd in a golang app which uses an embedded VueJS app. The VueJS app is embedded into golang using fileb0x. We're running into a race condition with modd on initial run because webpack takes too long to generate the files required for fileb0x to package up. This causes our prep which calls go generate to fail and ultimately our daemon never starts.

Our modd.conf is:

{
    prep: yarn install
    daemon: yarn watch
}

**/*.go {
  prep: go generate
  daemon: DEBUG=1 go run -tags="json1" main.go
}

yarn watch generates the files needed by fileb0x to package up in go generate

We've got developers on Windows and Linux, so my original workaround idea of adding a test for the generated files in a prep won't work. I could probably write a simple golang app to call in the prep which waits for the files to be generated and then exits... but that seems overkill.

Is there an existing config option to check/wait for the presence of a file/directory as a pre-condition or running the prep/daemon? Alternatively, is there a way to tell modd to keep retrying? Eventually the files get created and the go generate will succeed if it ever gets called again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant