Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. module.exports = function(grunt) {
  2.  
  3. var project_root = './public_html/';
  4.  
  5. var exclude_string = '!{node_modules,artifacts,sql,logs}/**';
  6.  
  7. grunt.initConfig({
  8.  
  9. pkg: grunt.file.readJSON('package.json'),
  10.  
  11. secret: grunt.file.readJSON('secret.json'),
  12.  
  13. sftp: {
  14.  
  15. upload: {
  16.  
  17. options: {
  18.  
  19. ignoreErrors:false,
  20.  
  21. host: '<%= secret.host %>',
  22.  
  23. username: '<%= secret.username %>',
  24.  
  25. password: '<%= secret.password %>',
  26.  
  27. showProgress: true,
  28.  
  29. },
  30.  
  31. }
  32.  
  33. },
  34.  
  35. watch: {
  36.  
  37. upload_tasks: {
  38.  
  39. files: [project_root + '/**', exclude_string],
  40. tasks: ['upload_files', 'sftp'],
  41. options: {
  42. reload: false,
  43. debounceDelay: 300,
  44. spawn: false, // this MUST BE FALSE!!!!!!!!!!!!!! dont change this.
  45.  
  46. },
  47.  
  48. },
  49.  
  50. },
  51.  
  52.  
  53. });
  54.  
  55. grunt.event.on('watch', function(action, filepath, target) {
  56.  
  57. grunt.config('sftp.upload.files', {filepath:filepath});
  58.  
  59. });
  60.  
  61. grunt.registerTask('upload_files', function(action, filepath, target) { // dummy used cuz idfk
  62.  
  63. });
  64.  
  65. grunt.loadNpmTasks('grunt-ssh');
  66.  
  67. grunt.loadNpmTasks('grunt-contrib-watch');
  68.  
  69. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement