function ensure(project) {
    return new Promise((resolve, reject) => {
      if (project.files.indexOf('wordpress') > -1) {
        ensureWpContentFolder(project)
          .then(ensureConfigFile(project, false))  
          .then(() => {
            console.log('Wordpress in place.');
            resolve();
          })
        .catch((error) => reject(error));
      } else {
        console.log('No wordpress folder found, downloading wordpress..');
        download('WordPress/WordPress', project.path + '/wordpress', (error) => {
          if (error) return reject(error);

          console.log('Done!');
          ensureConfigFile(project, true)
            .then(() => {
              console.log('Wordpress in place.');
              resolve()
            })
          .catch((error) => reject(error));
        });
      }
    });
  }
/** Ensure that the project has Wordpress downloaded and that the /wp-content and it's sub folders exists. */
Ensure that the project has Wordpress downloaded and that the /wp-content and it's sub folders exists.
Ensure that the project has Wordpress downloaded and that the / wp - content and it ' s sub folders exists .
function ensure(project) {
    return new Promise((resolve, reject) => {
      if (project.files.indexOf('wordpress') > -1) {
        ensureWpContentFolder(project)
          .then(ensureConfigFile(project, false))  
          .then(() => {
            console.log('Wordpress in place.');
            resolve();
          })
        .catch((error) => reject(error));
      } else {
        console.log('No wordpress folder found, downloading wordpress..');
        download('WordPress/WordPress', project.path + '/wordpress', (error) => {
          if (error) return reject(error);
          console.log('Done!');
          ensureConfigFile(project, true)
            .then(() => {
              console.log('Wordpress in place.');
              resolve()
            })
          .catch((error) => reject(error));
        });
      }
    });
  }
function ensure ( project ) { return new Promise ( ( resolve , reject ) => { if ( project . files . indexOf ( 'wordpress' ) > - 1 ) { ensureWpContentFolder ( project ) . then ( ensureConfigFile ( project , false ) ) . then ( ( ) => { console . log ( 'Wordpress in place.' ) ; resolve ( ) ; } ) . catch ( ( error ) => reject ( error ) ) ; } else { console . log ( 'No wordpress folder found, downloading wordpress..' ) ; download ( 'WordPress/WordPress' , project . path + '/wordpress' , ( error ) => { if ( error ) return reject ( error ) ; console . log ( 'Done!' ) ; ensureConfigFile ( project , true ) . then ( ( ) => { console . log ( 'Wordpress in place.' ) ; resolve ( ) } ) . catch ( ( error ) => reject ( error ) ) ; } ) ; } } ) ; }
Ensure that the project has Wordpress downloaded and that the /wp-content and it's sub folders exists.
Ensure that the project has Wordpress downloaded and that the / wp - content and it ' s sub folders exists .