|
|
|
@ -58,11 +58,23 @@ catch [System.Management.Automation.CommandNotFoundException] {
@@ -58,11 +58,23 @@ 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.email 'example@myemail.com'" |
|
|
|
|
|
|
|
|
|
function Test-CommandExists { |
|
|
|
|
param ($command) |
|
|
|
|
|
|
|
|
|
$oldPreference = $ErrorActionPreference |
|
|
|
|
$ErrorActionPreference = ‘stop’ |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if(Get-Command $command){ return $true } |
|
|
|
|
} Catch { return $false } |
|
|
|
|
Finally { $ErrorActionPreference=$oldPreference } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Test-CommandExists Get-Acl) { |
|
|
|
|
$permission = (Get-Acl $pwd).Access | |
|
|
|
|
?{$_.IdentityReference -match $env:UserName ` |
|
|
|
|
-and $_.FileSystemRights -match "FullControl" ` |
|
|
|
|
-or $_.FileSystemRights -match "Write" } | |
|
|
|
|
|
|
|
|
|
Select IdentityReference,FileSystemRights |
|
|
|
|
|
|
|
|
|
If (-Not $permission){ |
|
|
|
@ -70,6 +82,7 @@ If (-Not $permission){
@@ -70,6 +82,7 @@ If (-Not $permission){
|
|
|
|
|
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" |
|
|
|
|
|
|
|
|
|