Skip to content

Instantly share code, notes, and snippets.

@ryanpeach
Created April 26, 2020 03:09
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 ryanpeach/a2f6888340cfa30f4945590809c03390 to your computer and use it in GitHub Desktop.
Save ryanpeach/a2f6888340cfa30f4945590809c03390 to your computer and use it in GitHub Desktop.
Get the project directory as defined by the nearest git repo up your directory chain.
#!/usr/bin/env bash
export PROJECT_DIR=$(git rev-parse --show-toplevel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment