#!/usr/bin/env ruby
#
# replaces my custom ZSH shell prompt with the more conventional $ prefix.
#
# ---
# source: https://github.com/sunaku/home

print ARGF.read.gsub(/^(.+?)>(.+?)(?:\s*#(?:\d+)\w+\d+:\d+(?i:[ap]m)?)?$/) { |original|
  if File.directory? File.expand_path($1.split.last.to_s)
    "\n$#{$2}"
  else
    original
  end
}
