yedhink / bashed-on-a-feeling Goto Github PK
View Code? Open in Web Editor NEW:zap: fast and minimalistic git prompt written in bash
License: MIT License
:zap: fast and minimalistic git prompt written in bash
License: MIT License
Hi again, I wanted to customize my prompt and swap to Dejavu fonts rather than install the ones you specified. I'm not sure if you would want further documentation but here's how I went about monkey patching the fonts and overall prompt. I know this is ugly but I wasn't sure how you might want this too look -it's something to think about anyway :D
# Save PS1 for my customization later
SAVED_PS1="${PS1}"
# git prompt will be shown only when you move to a git dir
gitprompt(){
if git status &> /dev/null; then
declare -i cno=0
# customize the prompt settings
# explore your fonts here: [CharMap - Powered by OpenType.js](https://char-map.herokuapp.com/)
# override if needed: common dejavu sans fonts
: ${no_remote_added:='✘'}
: ${commiticon:='♥'}
: ${added_but_not_committed:='♡'}
: ${committed_and_clean:='✔'}
: ${ahead:='⬆'}
: ${behind:='⬇'}
: ${committed_but_modified_before_push:='✚'}
: ${untracked_files:='⁇'}
: ${gitprompt_normal:='☮'}
: ${gitprompt_diverged:='☢'}
# source the script
source ~/.bashed-gitprompt.sh
# customize the prompt (removes columns)
PS1='\
\[$Purple\]\u\
\[$rst\]@\
\[$Cyan\]\H\
\[$rst\]:\
\[$dirfg\]\w \
\[$boldWhite\]$gitprompt\
\[$rst\] \
\[$rst\]\[$Yellow\] $commitstot\[$Red\]$commiticon \
${PS1RHS}\
\n\
\[$rst\]\[$boldGreen\]$\
\[$rst\] '
#export PS1="\[${Save}\e[${COLUMNS}C\e[${#PS1RHS_stripped}D${PS1RHS}${Rest}\]${PS1}"
export PS1="${PS1}" # redundant but easier for debugging/testing
else
#export PS1='\[$normalHeart\]♥ \[$normalCDire\]\W \[$Yellow\]\$\[\e[0m\] '
export PS1="${SAVED_PS1}"
gbranch=""
fi
}
$ ./install.sh
cp: illegal option -- t
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
$
Hi, nice job.
On my system I get the following error message output when working in a local (non remote) repository:
fatal: ambiguous argument 'origin/master..': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
The problem stems from an unchecked git diff --stat origin/master
in the case where origin has not been set (i.e. no remote exists). I have a pull request ready though and will submit it here in a bit.
Hi,
Trying to use your script on bash under Windows Subsystem for Linux and getting the following error "bash: [: too many arguments" when executing bash commands.
Thought I messed up the installation, but full clean reinstall did not help.
Any ideas what might be the cause?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.