Skip to content

Watches a local directory and uploads changes via webdav to a remote directory.

License

Notifications You must be signed in to change notification settings

rushkeldon/davup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

davup

Watches a local directory ( via chokidar ) and uploads changes using webdav ( ala cyberduck cli ) to a remote directory

NPM

Why?

  • Tired of running Eclipse just so that Demandware cartridge changes would be uploaded via webdav
  • Wanted to integrate webdav upload into projects' gulp tasks

Getting started

External Dependencies

Install with npm :

npm install davup --save

Then require and use it in your code :

    // example of an options object you can (optionally) pass to davup.start
    var options = {
     "username": "devgod",
     "localDir": "/full/local/path/to/dir/to/watch/",
     "remoteDir": "domain.com/full/path/to/dir/upload/to/",
     "password": "secretwerd"
    };

Here is an example of a gulpfile ( in Coffeescript ) using davup.

This example also uses run-sequence which is quite handy for waiting until the davup promise is resolved before continuing with your build process.

Apparently gulp 4.0 will support synchronous blocking tasks without the need for awesomeness like run-sequence.

NOTE : Without some sort of blocking help such as run-sequence the input via terminal looks pretty funky in a gulp environment - but does work.

g = require 'gulp'
davup = require 'davup'
runSequence = require 'run-sequence'

g.task 'startdav', ->
    # you can pass an options argument to start to create or overwrite the config.dat file
    # otherwise you will be prompted for config data
    return davup.start()

g.task 'build-all', ( callback ) ->
    runSequence 'stylus', 'coffee-modules', 'coffee-services', callback

g.task 'default', ( callback ) ->
    runSequence 'startdav', 'build-all', 'watch', callback
    

Next Planned Features

  • Detect missing external dependency 'cyberduck cli' a.k.a. 'duck' and fail gracefully with information
  • Add facility to flag saving the password in config.dat - currently hand editing is the only mechanism

Possible Future Features

  • Replace cyberduck with suitable node-friendly option - not totally sure this would be worth the effort - interesting in hearing opinions
  • Demandware specific feature : ability to flatten cartridges if they are nested locally - again, only if there is enough interest

About

Watches a local directory and uploads changes via webdav to a remote directory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published