Always fixup clone win_git repo owner
This commit is contained in:
parent
3b312e6f9a
commit
58cd98c817
@ -127,14 +127,6 @@ function Invoke-GitClone {
|
||||
if ($result.rc -ne 0) {
|
||||
$module.FailJson($result.stderr)
|
||||
}
|
||||
# Ensure the newly cloned repository has the correct owner
|
||||
$userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
|
||||
$idRef = [System.Security.Principal.NTAccount]::new($userName)
|
||||
Get-Item $dest | foreach { `
|
||||
$_ ; $_ | Get-ChildItem -Force -Recurse `
|
||||
} | foreach { `
|
||||
$acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl `
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-GitCheckout {
|
||||
@ -228,4 +220,13 @@ if ($recursive) {
|
||||
Invoke-GitSubmoduleUpdate $dest
|
||||
}
|
||||
|
||||
# Ensure the repository has the correct owner
|
||||
$userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
|
||||
$idRef = [System.Security.Principal.NTAccount]::new($userName)
|
||||
Get-Item $dest | foreach { `
|
||||
$_ ; $_ | Get-ChildItem -Force -Recurse `
|
||||
} | foreach { `
|
||||
$acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl `
|
||||
}
|
||||
|
||||
$module.ExitJson()
|
||||
|
@ -9,10 +9,6 @@
|
||||
repo: git@code.infektor.net:config/AutoHotKey.git
|
||||
dest: '{{autohotkey_repo_dir}}'
|
||||
branch: master
|
||||
- win_owner:
|
||||
path: '{{autohotkey_repo_dir}}'
|
||||
user: Benie
|
||||
recurse: true
|
||||
|
||||
- name: create scheduled task
|
||||
win_scheduled_task:
|
||||
|
@ -12,7 +12,3 @@
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{obsidian_notes_repo}}'
|
||||
branch: main
|
||||
- win_owner:
|
||||
path: '{{obsidian_notes_repo}}'
|
||||
user: Benie
|
||||
recurse: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user