Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prompt: () => {
- const time = new Date().toLocaleTimeString().green;
- const cwd = shell.cwd.cyan;
- const sign = '$'.yellow;
- const isGitRepo = fs.existsSync(path.join(shell.absoluteCwd, '.git'));
- let gitBranch = isGitRepo ? shell.exec('git rev-parse --abbrev-ref HEAD').trim() : 'not a repo';
- gitBranch = ('{' + gitBranch + '}').red;
- return `${time} ${cwd} ${gitBranch} ${sign} `;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement