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

In post-receive run gulp also on JS file changes #172

Open
samikeijonen opened this issue Feb 6, 2021 · 2 comments
Open

In post-receive run gulp also on JS file changes #172

samikeijonen opened this issue Feb 6, 2021 · 2 comments

Comments

@samikeijonen
Copy link
Contributor

samikeijonen commented Feb 6, 2021

It's common that Gulp handles all the assets like CSS and JS. At the moment gulp is run when $SCSS_CHANGED is true in post-receive hook.

It would make sense that by default it would catch changes on JS files also. Maybe it can be called ASSETS_CHANGED instead of SCSS_CHANGED.

And then something like:

ASSETS_CHANGED=false
elif [[ "$line" =~ \.scss ]] || [[ "$line" =~ \.js ]]
    then
      ASSETS_CHANGED=true

I'm also not certain should there be npm install before gulp, haven't tested this yet.

@ottok
Copy link
Contributor

ottok commented Feb 18, 2021

Sorry for late reply. We don't have npm install in the example, as it often is so slow and pulling in a lot of dependencies might cause unpredictable end results.

You are however free to modify the git hook in your own project to perfectly fit your custom needs. The project template is an example of how things can be done and there is no need to adhere to it exactly.

If/when there later are updates to the project template, you can either use git merge or wp-fix-project to import new upstream changes.

@samikeijonen
Copy link
Contributor Author

Yep, we already modified this :)

P.S. I'd personally add comment around gulp since it doesn't do anything on it's own. And it makes assumption that there is no build or dist folder in the repo.

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

2 participants