Skip to content

Commit

Permalink
Replace home dir with ~
Browse files Browse the repository at this point in the history
  • Loading branch information
apauley committed Jul 26, 2016
1 parent d5e0573 commit 65e18af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/PromptLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,18 @@ rebaseNeeded currentBranch trackBranch = do
hostPwd :: IO Text
hostPwd = do
h <- hostname
w <- pwd
w <- promptPwd
let host = colourUnlessNull lightPurpleFG h
let cwd = colourUnlessNull lightBlueFG $ format fp w
let cwd = colourUnlessNull lightBlueFG w
return $ host <> ":" <> cwd

promptPwd :: IO Text
promptPwd = do
h <- home
w <- pwd

let cwd = sed (text (format fp h) *> return "~") (return (format fp w)) :: Shell Text
fmap T.strip $ strict cwd

recentNHashes :: Text -> Int -> Shell Text
recentNHashes branch limit = gitDiscardErr "log" ["-n", repr limit, "--format=%H", branch]

0 comments on commit 65e18af

Please sign in to comment.