Robert-W / grunt-ftp-push

Deploy files to an FTP server as part of your Grunt workflow.
MIT License
39 stars 14 forks source link

incrementalUpdates: false failing with "Fatal error: Cannot read property 'src' of undefined" #47

Closed joeymigs closed 8 years ago

joeymigs commented 8 years ago

After finding that changing remote files (but not 'local' 'src' files) triggers a No new files to push. If you want to force push all your files, set incrementalUpdates to true in your options. response (which I mistakenly didn't expect at first, but now believe is normal behavior), I tried changing my config to incrementalUpdates: false (as true is the default and produced the same results as leaving the option out entirely) to "force" push files, but have been getting this response: Fatal error: Cannot read property 'src' of undefined.

Is my config bad, or is this maybe an issue?

ftp_push: {
  options: {
    host: 'my-server.com',
    port: 21,
    authKey: 'key',
    dest: './',
    incrementalUpdates: false
  },
  test: {
    expand: true,
    cwd: './',
    src: [
      'test_dir/*',
      '!**/.DS_Store'
    ],
    dest: 'path/to/dest_dir'
  }
}
Robert-W commented 8 years ago

Thanks @joeymigs for reporting this, that seems like it might be an issue. If there is a configuration error I generally try to give more helpful warnings. I'll test out the config later today and post some updates here.

In the meantime, you could always install the previous version since that does not have the incremental updates feature. npm install grunt-ftp-push@1.0.0.

Robert-W commented 8 years ago

@joeymigs Looks like this may be a configuration error. I will add some warnings to the next version that will make this a little easier to catch. You can see a sample configuration here: https://github.com/Robert-W/grunt-ftp-push#overview. Your ftp_push configuration has two keys, an options and a test, you need to rename test to files and use the files array format. It should look like this:

ftp_push: {
  options: {
    host: 'my-server.com',
    port: 21,
    authKey: 'key',
    dest: './',
    incrementalUpdates: false
  },
  files: [{
    expand: true,
    cwd: './',
    src: [
      'test_dir/*',
      '!**/.DS_Store'
    ],
    dest: 'path/to/dest_dir'
  }]
}
joeymigs commented 8 years ago

@Robert-W Thanks very much for the quick attention! I just reinstalled the plugin and tried the test again as is (with both test and options as configuration keys), and it works exactly as I was expecting now (even without explicitly using the files array format)! I'd say this update did the trick!

Love the plugin--thanks for maintaining it!

Robert-W commented 8 years ago

No problem, glad everything worked out (especially since its not using the files array format).