packages/create-slate-theme/create-slate-theme.js
function cloneFromGit(hostInfo, root, ssh) {
  const branch = hostInfo.committish ? `-b ${hostInfo.committish}` : '';
  let url;

  if (ssh) {
    url = hostInfo.ssh({noCommittish: true});
  } else {
    url = hostInfo.https({noCommittish: true, noGitPlus: true});
  }

  console.log(`Cloning theme from a git repo: ${chalk.green(url)}`);

  return utils
    .spawn(`git clone ${branch} ${url} "${root}" --single-branch`, {
      stdio: 'pipe',
    })
    .then(() => {
      return fs.remove(path.join(root, '.git'));
    })
    .catch((error) => {
      console.log();
      console.log(chalk.red('There was an error while cloning the git repo:'));
      console.log('');
      console.log(chalk.red(error));

      process.exit(1);
    });
}
function cloneFromGit(hostInfo, root, ssh) {
  const branch = hostInfo.committish ? `-b ${hostInfo.committish}` : '';
  let url;

  if (ssh) {
    url = hostInfo.ssh({noCommittish: true});
  } else {
    url = hostInfo.https({noCommittish: true, noGitPlus: true});
  }

  console.log(`Cloning theme from a git repo: ${chalk.green(url)}`);

  return utils
    .spawn(`git clone ${branch} ${url} "${root}" --single-branch`, {
      stdio: 'pipe',
    })
    .then(() => {
      return fs.remove(path.join(root, '.git'));
    })
    .catch((error) => {
      console.log();
      console.log(chalk.red('There was an error while cloning the git repo:'));
      console.log('');
      console.log(chalk.red(error));

      process.exit(1);
    });
}
function cloneFromGit ( hostInfo , root , ssh ) { const branch = hostInfo . committish ? ` ${ hostInfo . committish } ` : '' ; let url ; if ( ssh ) { url = hostInfo . ssh ( { noCommittish : true } ) ; } else { url = hostInfo . https ( { noCommittish : true , noGitPlus : true } ) ; } console . log ( ` ${ chalk . green ( url ) } ` ) ; return utils . spawn ( ` ${ branch } ${ url } ${ root } ` , { stdio : 'pipe' , } ) . then ( ( ) => { return fs . remove ( path . join ( root , '.git' ) ) ; } ) . catch ( ( error ) => { console . log ( ) ; console . log ( chalk . red ( 'There was an error while cloning the git repo:' ) ) ; console . log ( '' ) ; console . log ( chalk . red ( error ) ) ; process . exit ( 1 ) ; } ) ; }
Clones starter from URI.
Clones starter from URI .