=Fixed linux bug with latest edit-textfile change
This commit is contained in:
parent
d33131cd78
commit
a8f55a151d
|
@ -18,16 +18,16 @@ end {
|
|||
$local:editor = $null
|
||||
foreach( $local:testEditor in $editors ) {
|
||||
if( $(try{Get-Command -ListImported -Type Application $testEditor -ErrorAction SilentlyContinue}catch{}) ) {
|
||||
$editor = $testEditor
|
||||
$editor = "`"$testEditor`""
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( $editor -match 'vim?$' ) {
|
||||
if( $editor -match 'vim?"$' ) {
|
||||
$editor += ' -p'
|
||||
}
|
||||
|
||||
if( $editor -match 'code(\.exe)?$' ) {
|
||||
if( $editor -match 'code(\.exe)?"$' ) {
|
||||
if( -not (Get-Process -Name 'code' -ErrorAction SilentlyContinue) ) {
|
||||
Invoke-ExpressionEx -sudo:$sudo $editor
|
||||
}
|
||||
|
@ -39,6 +39,6 @@ end {
|
|||
if( $Path ) { $arguments = "$arguments" }
|
||||
|
||||
if( $PSCmdlet.ShouldProcess( "Edit ($editor): $arguments" ) ) {
|
||||
Invoke-ExpressionEx -sudo:$sudo "& `"$editor`"" "$arguments"
|
||||
Invoke-ExpressionEx -sudo:$sudo "& $editor $arguments"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue