mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix(pwsh): do not validate permissions before set
the current implementation is too flacky and breaks the module on certain unix systems relates to #393
This commit is contained in:
parent
f92904af5e
commit
59b0595c5b
|
@ -28,21 +28,7 @@ function Set-ExecutablePermissions {
|
|||
return
|
||||
}
|
||||
|
||||
# Check the permissions on the file
|
||||
$permissions = ((ls -l $executable) -split ' ')[0] # $permissions will be something like '-rw-r--r--'
|
||||
if ((id -u) -eq 0) {
|
||||
# Running as root, give global executable permissions if needed
|
||||
$hasExecutable = $permissions[3] -eq 'x'
|
||||
if (-not $hasExecutable) {
|
||||
Invoke-Expression -Command "chmod g+x $executable"
|
||||
}
|
||||
return
|
||||
}
|
||||
# Running as user, give user executable permissions if needed
|
||||
$hasExecutable = $permissions[9] -eq 'x'
|
||||
if (-not $hasExecutable) {
|
||||
Invoke-Expression -Command "chmod +x $executable"
|
||||
}
|
||||
Invoke-Expression -Command "chmod +x $executable"
|
||||
}
|
||||
|
||||
function Set-PoshPrompt {
|
||||
|
|
Loading…
Reference in a new issue