diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-10-10 20:09:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-10 20:09:55 -0400 |
commit | a7e8655287e93ce16c14c191dd8e6eca13fa48db (patch) | |
tree | bb10e3942efe7e972197afafb99f599da0de2ab4 /docs/static/setup.sh | |
parent | d38740cebf3be17a7d55fc51f5f06752182f96d8 (diff) | |
parent | 4aa45c6f40c3e640cebce58b4d10cd24dc61b8ed (diff) |
Merge pull request #256 from careyk007/check_directory_write_permissions_in_setup_script
Exit setup if no write permissions in directory
Diffstat (limited to 'docs/static/setup.sh')
-rw-r--r-- | docs/static/setup.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 49ed3eb..96e8768 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -22,6 +22,13 @@ check_exists "command -v curl" "curl is not installed, and is required for this check_exists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'" check_exists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'" +# Check to see if the user has write permissions in this directory to prevent a cryptic error later on +if [ ! -w `pwd` ]; then + echo 'Sorry, you do not have write permissions in this directory.'; + echo 'Please try running this script again from a directory that you do have write permissions for.'; + exit 1 +fi + repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git" title="ZMK Config Setup:" |