summaryrefslogtreecommitdiff
path: root/docs/static
diff options
context:
space:
mode:
authorMubeen Khan <mubeen@mubeen.co>2020-10-11 23:17:04 -0500
committerGitHub <noreply@github.com>2020-10-11 23:17:04 -0500
commitd45e7b3c1190209953d5ffefff39f23341dbd88c (patch)
treed49b709299c9e29e41fadfa6f20d2e8ee9159cdc /docs/static
parent7fc7a351170fb2017cb40e8de79b4535a936a6f6 (diff)
parentba73e5d4ac295cc67e03fca9f80030022b8f529c (diff)
Merge pull request #7 from zmkfirmware/main
Update to stay even with upstream main
Diffstat (limited to 'docs/static')
-rw-r--r--docs/static/setup.ps115
-rw-r--r--docs/static/setup.sh7
2 files changed, 21 insertions, 1 deletions
diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1
index abdb698..63bd5c0 100644
--- a/docs/static/setup.ps1
+++ b/docs/static/setup.ps1
@@ -57,7 +57,20 @@ catch [System.Management.Automation.CommandNotFoundException] {
}
Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'"
-Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.name 'example@myemail.com'"
+Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.email 'example@myemail.com'"
+
+$permission = (Get-Acl $pwd).Access |
+?{$_.IdentityReference -match $env:UserName `
+ -and $_.FileSystemRights -match "FullControl" `
+ -or $_.FileSystemRights -match "Write" } |
+
+ Select IdentityReference,FileSystemRights
+
+If (-Not $permission){
+ Write-Host "Sorry, you do not have write permissions in this directory."
+ Write-Host "Please try running this script again from a directory that you do have write permissions for."
+ exit 1
+}
$repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git"
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:"