Advertisement
Guest User

Untitled

a guest
Feb 6th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. var gulp = require('gulp'),
  2. sys = require('sys'),
  3. ssh2 = require('ssh2');
  4.  
  5. gulp.task('phpunit', function() {
  6. var ssh = new ssh2();
  7.  
  8. ssh.on('ready', function () {
  9. ssh.exec('cd /vagrant; phpunit', {}, function (err, stream) {
  10.  
  11. stream.on('data', function (data, extended) {
  12. sys.puts(data);
  13. });
  14.  
  15. stream.on('end', function () {
  16. ssh.end();
  17. });
  18.  
  19. });
  20. });
  21.  
  22. ssh.connect({
  23. host: '127.0.0.1',
  24. port: 2222,
  25. username: 'vagrant',
  26. password: 'vagrant'
  27. });
  28. });
  29.  
  30. gulp.task('default', function() {
  31. gulp.watch('app/**/*.php', { debounceDelay: 2000 }, ['phpunit']);
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement