Last active
August 21, 2018 17:01
-
-
Save sgen/578cd938eb5a49a6b420938d36630587 to your computer and use it in GitHub Desktop.
Find the project root from a script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $(cd $(dirname "$0"); pwd -P) finds the scripts path; | |
# | |
# /../ Is the path of the script relative to the project root | |
# | |
# realpath normalizes the path | |
export project_root=$(realpath $(cd $(dirname "$0"); pwd -P)/../); | |
echo "$project_root"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment