easy-aos
Version:
帮助配置arm-gcc开发环境,简化命令行。
39 lines (35 loc) • 1.17 kB
JavaScript
import easyAos from "../lib/env"
import chalk from "chalk"
const theme = {}
theme.name = "powerline"
theme.reset = chalk.reset
theme.env = chalk.bgBlue.black
theme.env_split = chalk.blue
theme.path = chalk.white
theme.path_split = chalk.bgCyanBright.gray
theme.git_status = chalk.bgCyanBright.black
theme.git_status_split = chalk.cyanBright.bgMagenta
theme.git_branch = chalk.bgMagenta
theme.git_branch_split = chalk.magenta
const split = "",
git_staged = "✔",
git_detached = "⚓",
git_ahead = "⬆",
git_behind = "⬇",
git_changed = "✎",
git_new = "?",
git_conflicted = "✼",
git_stash = "⎘"
const easyPrompt = function (gitStatus) {
let env = ` ${easyAos.conda.env} `,
pwd = ` ${easyAos.pwd} `,
git_status = " 11 "
let prompt = `${theme.env(env)}${theme.env_split(split)}`
prompt += `${theme.reset()} ${theme.path(pwd)} ${theme.path_split(split)}`
prompt += `${theme.git_status(git_status)}${theme.git_status_split(split)}`
prompt += `${theme.git_branch(` ${gitStatus} `)}${theme.git_branch_split(split)}`
prompt += `${theme.reset()}`
prompt += "\n$"
return prompt
}
export default easyPrompt