Advertisement
Guest User

Untitled

a guest
May 23rd, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prompt: () => {
  2.             const time = new Date().toLocaleTimeString().green;
  3.             const cwd = shell.cwd.cyan;
  4.             const sign = '$'.yellow;
  5.  
  6.             const isGitRepo = fs.existsSync(path.join(shell.absoluteCwd, '.git'));
  7.             let gitBranch = isGitRepo ? shell.exec('git rev-parse --abbrev-ref HEAD').trim() : 'not a repo';
  8.             gitBranch = ('{' + gitBranch + '}').red;
  9.  
  10.             return `${time} ${cwd} ${gitBranch} ${sign} `;
  11.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement