Skip to content

Instantly share code, notes, and snippets.

@BrianLitwin
Last active February 24, 2019 19:56
Show Gist options
  • Save BrianLitwin/aef048901b9636a42007c44aa3da4c42 to your computer and use it in GitHub Desktop.
Save BrianLitwin/aef048901b9636a42007c44aa3da4c42 to your computer and use it in GitHub Desktop.
  1. sourcecred clear --all -- removes the whole $SOURCECRED_DIRECTORY
  2. sourcecred clear --cache -- removes just the cache directory
  3. sourcecred clear -- prompts the user to be more specific

Then those errors that are thrown can report exactly how to fix them, i.e. when we have the wrong version of repoIdRegistry, we can ensure that "try running sourcecred clear --all" is printed to console.

Use: https://github.com/sourcecred/sourcecred/blob/master/src/cli/common.js#L19

  1. add a command to the CLI directory
  2. update Sourcecred.js, the entry point
  3. update help.js
// sourcecred.js 
case "clear":
      return clear(args.slice(1), std);
 
// help.js
Commands:
      load      load repository data into SourceCred
      analyze   analyze cred for a loaded repository
      help      show this help message
      clear     clear SourceCred repository data 

 

make a command to get cache const cacheDirectory = scopedDirectory("cache");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment