Skip to content

Instantly share code, notes, and snippets.

@Illizian
Last active January 21, 2016 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Illizian/c4c1893ddcd4e6f72f65 to your computer and use it in GitHub Desktop.
Save Illizian/c4c1893ddcd4e6f72f65 to your computer and use it in GitHub Desktop.
A script for generating the requisite directory structure for VSCode's "Local History" plugin

Having installed VSCode's Local History plugin I found that I was getting ENOENT errors. This command will generate the required directory structure within your projects .history folder.

Please Note: This will remove any existing .history folder from your project.

Installation

  1. Open your .bash_profile or .zshrc file
  2. Add script.sh to the bottom of the file
  3. Either restart your terminal, or run source .bash_profile or source .zshrc

Usage

  1. Open Terminal and navigate to your working directory
  2. Run the command gen-vshistory
  3. Lean back and wait for your .history/ directory to be created
gen-vshistory() {
echo "Cloning directory structure to ./.history"
rm -rf .history
rm -rf /tmp/.history
find . -type d -exec mkdir -p -- /tmp/.history/{} \;
mv /tmp/.history ./.history
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment