Skip to content

Instantly share code, notes, and snippets.

@fatorx
Created January 2, 2017 14:59
Show Gist options
  • Save fatorx/489776ec93feb1d26359e1d41d0a1d22 to your computer and use it in GitHub Desktop.
Save fatorx/489776ec93feb1d26359e1d41d0a1d22 to your computer and use it in GitHub Desktop.
Gulp execute script PHP
var exec = require('child_process').exec
gulp.task('update-templates', function(){
exec('php scripts/update-html.php', function (err, stdout, stderr) {
console.log(stdout)
console.log(stderr)
})
})
gulp.task('default',['update-templates'])
@happy-code-time
Copy link

Nice

@gregzawadzki
Copy link

Acually, it will freeze. You need to tell the process to it has finished.

gulp.task('update-templates', function(imdone){
    
    exec('php scripts/update-html.php', function (err, stdout, stderr) {
        console.log(stdout)
        console.log(stderr)
        imdone();
    })
})

@fatorx
Copy link
Author

fatorx commented May 24, 2023

@seigieu thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment