diff options
author | Kellen Carey <kellen.carey@gmail.com> | 2020-10-09 18:53:21 -0700 |
---|---|---|
committer | Kellen Carey <kellen.carey@gmail.com> | 2020-10-09 18:53:21 -0700 |
commit | b64517943deb3dfe72e2e37ca62319856bc35752 (patch) | |
tree | 845c695847979640c554cb45ec7595349abaa84f /docs | |
parent | 10029c297ed8f6d97b582bc7382d9e9558808884 (diff) |
add powershell check
Diffstat (limited to 'docs')
-rw-r--r-- | docs/static/setup.ps1 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index abdb698..1da5737 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -59,6 +59,19 @@ 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'"
+$permission = (Get-Acl $PSScriptRoot).Access |
+?{$_.IdentityReference -match $env:UserName `
+ -and $_.FileSystemRights -match "Read" `
+ -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"
$title = "ZMK Config Setup:"
|