Skip to content

Instantly share code, notes, and snippets.

@rhysd
Created September 6, 2016 08:31
Show Gist options
  • Save rhysd/a4c254220186078deb820ee8f68264d0 to your computer and use it in GitHub Desktop.
Save rhysd/a4c254220186078deb820ee8f68264d0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
file = "#{ENV['HOME']}/.chpwd-recent-dirs"
File.write(
file,
File::foreach(file).select{|l| l =~ /^\$'(.*)'/ && Dir.exists?($1) }.join
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment