Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(grunt) {
- var project_root = './public_html/';
- var exclude_string = '!{node_modules,artifacts,sql,logs}/**';
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
- secret: grunt.file.readJSON('secret.json'),
- sftp: {
- upload: {
- options: {
- ignoreErrors:false,
- host: '<%= secret.host %>',
- username: '<%= secret.username %>',
- password: '<%= secret.password %>',
- showProgress: true,
- },
- }
- },
- watch: {
- upload_tasks: {
- files: [project_root + '/**', exclude_string],
- tasks: ['upload_files', 'sftp'],
- options: {
- reload: false,
- debounceDelay: 300,
- spawn: false, // this MUST BE FALSE!!!!!!!!!!!!!! dont change this.
- },
- },
- },
- });
- grunt.event.on('watch', function(action, filepath, target) {
- grunt.config('sftp.upload.files', {filepath:filepath});
- });
- grunt.registerTask('upload_files', function(action, filepath, target) { // dummy used cuz idfk
- });
- grunt.loadNpmTasks('grunt-ssh');
- grunt.loadNpmTasks('grunt-contrib-watch');
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement