lib/pkgcloud-bootstrapper.js
function bootstrap(next) {
      if (!options.commands || !options.commands.length) {
        return next();
      }

      var hasErr;

      self.ssh({
        keys: options.keys,
        server: options.server,
        commands: options.commands,
        remoteUser: options.remoteUser,
        tunnel: options.tunnel
      }).on('error', function (err) {
        if (!hasErr) {
          hasErr = true;
          next(err);
        }
      }).on('complete', function (server, stdout) {
        if (!hasErr) {
          next(null, stdout);
        }
      });
    }
function bootstrap(next) {
      if (!options.commands || !options.commands.length) {
        return next();
      }

      var hasErr;

      self.ssh({
        keys: options.keys,
        server: options.server,
        commands: options.commands,
        remoteUser: options.remoteUser,
        tunnel: options.tunnel
      }).on('error', function (err) {
        if (!hasErr) {
          hasErr = true;
          next(err);
        }
      }).on('complete', function (server, stdout) {
        if (!hasErr) {
          next(null, stdout);
        }
      });
    }
function bootstrap ( next ) { if ( ! options . commands || ! options . commands . length ) { return next ( ) ; } var hasErr ; self . ssh ( { keys : options . keys , server : options . server , commands : options . commands , remoteUser : options . remoteUser , tunnel : options . tunnel } ) . on ( 'error' , function ( err ) { if ( ! hasErr ) { hasErr = true ; next ( err ) ; } } ) . on ( 'complete' , function ( server , stdout ) { if ( ! hasErr ) { next ( null , stdout ) ; } } ) ; }
3. Bootstrap the server with the appropriate commands.
3 . Bootstrap the server with the appropriate commands .