Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add push/pull_all_files_from_path() tasks #3

Open
jambox opened this issue Mar 6, 2015 · 0 comments
Open

Add push/pull_all_files_from_path() tasks #3

jambox opened this issue Mar 6, 2015 · 0 comments

Comments

@jambox
Copy link
Collaborator

jambox commented Mar 6, 2015

Add two helper tasks to push/pull and files specified in the target.path key. Thanks @gyopiazza for the suggestion! Starter pseudo code:

grunt.registerTask("pull_all_files_from_paths",
  "Pull files from all directories defined in the path obj.",
  function () {

    if (local_options.path !== null && typeof local_options.path === 'object') {
      for (var key in local_options.path) {
        if( target_options.path[key] !== null ) {

          // Build config object with other necessary params

          // var config = {
          //   rsync_args: rsync_args,
          //   ssh_host: target_options.ssh_host,
          //   exclusions: exclusions
          // };
          // config.from = local_options.path[key];
          // config.to = target_options.path[key];
          util.rsync_push(config);
        } else  {
          grunt.fail.fatal('Trying to pull files files from target with no matching path for' + key + '!')
        }
      }
    } else {
      grunt.fail.fatal('Trying to pull files without a path object in config!')
    }

  }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant