function hostname(siteName, domain = 'ddev.local') {
  const promise = new Promise((resolve, reject) => {
    const options = {
      name: 'DDEV UI',
    };

    const command = `ddev hostname ${siteName}.${domain} 127.0.0.1 -j`;
    exec(command, options, (error, stdout, stderr) => {
      if (error) {
        console.log(stderr);
        reject(error);
      } else {
        resolve(stdout);
      }
    });
  });
  return promise;
}
/**
 * wrapper for `ddev hostname`, attempts to run as sudo
 * @param siteName {string} - sitename to create hostname entry for
 * @param domain - optional - domain to create sitename subdomain
 * @returns {Promise} - resolves on successful execution with stdout text
 */
wrapper for `ddev hostname`, attempts to run as sudo
@param siteName {string} - sitename to create hostname entry for
@param domain - optional - domain to create sitename subdomain
@returns {Promise} - resolves on successful execution with stdout text
wrapper for ` ddev hostname ` attempts to run as sudo @param siteName { string } - sitename to create hostname entry for @param domain - optional - domain to create sitename subdomain @returns { Promise } - resolves on successful execution with stdout text
function hostname(siteName, domain = 'ddev.local') {
  const promise = new Promise((resolve, reject) => {
    const options = {
      name: 'DDEV UI',
    };
    const command = `ddev hostname ${siteName}.${domain} 127.0.0.1 -j`;
    exec(command, options, (error, stdout, stderr) => {
      if (error) {
        console.log(stderr);
        reject(error);
      } else {
        resolve(stdout);
      }
    });
  });
  return promise;
}
function hostname ( siteName , domain = 'ddev.local' ) { const promise = new Promise ( ( resolve , reject ) => { const options = { name : 'DDEV UI' , } ; const command = ` ${ siteName } ${ domain } ` ; exec ( command , options , ( error , stdout , stderr ) => { if ( error ) { console . log ( stderr ) ; reject ( error ) ; } else { resolve ( stdout ) ; } } ) ; } ) ; return promise ; }
wrapper for `ddev hostname`, attempts to run as sudo
 @param siteName {string} - sitename to create hostname entry for
 @param domain - optional - domain to create sitename subdomain
 @returns {Promise} - resolves on successful execution with stdout text
wrapper for ` ddev hostname ` attempts to run as sudo @param siteName { string } - sitename to create hostname entry for @param domain - optional - domain to create sitename subdomain @returns { Promise } - resolves on successful execution with stdout text