tasks/ftp_push.js
function getCredentials(gruntOptions) {
    if (gruntOptions.authKey && grunt.file.exists('.ftpauth')) {
      return JSON.parse(grunt.file.read('.ftpauth'))[gruntOptions.authKey];
    } else if (gruntOptions.username && gruntOptions.password) {
      return { username: gruntOptions.username, password: gruntOptions.password };
    } else {
      // Warn the user we are attempting an anonymous login
      grunt.log.warn(messages.anonymousLogin);
      return { username: null, password: null };
    }
  }
function getCredentials(gruntOptions) {
    if (gruntOptions.authKey && grunt.file.exists('.ftpauth')) {
      return JSON.parse(grunt.file.read('.ftpauth'))[gruntOptions.authKey];
    } else if (gruntOptions.username && gruntOptions.password) {
      return { username: gruntOptions.username, password: gruntOptions.password };
    } else {
      // Warn the user we are attempting an anonymous login
      grunt.log.warn(messages.anonymousLogin);
      return { username: null, password: null };
    }
  }
function getCredentials ( gruntOptions ) { if ( gruntOptions . authKey && grunt . file . exists ( '.ftpauth' ) ) { return JSON . parse ( grunt . file . read ( '.ftpauth' ) ) [ gruntOptions . authKey ] ; } else if ( gruntOptions . username && gruntOptions . password ) { return { username : gruntOptions . username , password : gruntOptions . password } ; } else { // Warn the user we are attempting an anonymous login grunt . log . warn ( messages . anonymousLogin ) ; return { username : null , password : null } ; } }
Based off of whats in the options, create a credentials object
@param {object} options - grunt options provided to the plugin
@return {object} {username: '...', password: '...'}
Based off of whats in the options create a credentials object