mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-11 07:19:49 +01:00
Updated edit.ps1
This commit is contained in:
parent
7229b3d980
commit
7618c3548c
@ -17,7 +17,7 @@ param([string]$path = "")
|
|||||||
|
|
||||||
function TryEditor { param([string]$editor, [string]$path)
|
function TryEditor { param([string]$editor, [string]$path)
|
||||||
try {
|
try {
|
||||||
Write-Host -noNewline "$editor·"
|
Write-Host "$editor.." -noNewline
|
||||||
& $editor "$path"
|
& $editor "$path"
|
||||||
if ($lastExitCode -ne "0") {
|
if ($lastExitCode -ne "0") {
|
||||||
"⚠️ Can't execute '$editor' - make sure it's installed and available"
|
"⚠️ Can't execute '$editor' - make sure it's installed and available"
|
||||||
@ -32,7 +32,8 @@ function TryEditor { param([string]$editor, [string]$path)
|
|||||||
try {
|
try {
|
||||||
if ($path -eq "" ) { $path = Read-Host "Enter the path to the text file" }
|
if ($path -eq "" ) { $path = Read-Host "Enter the path to the text file" }
|
||||||
|
|
||||||
Write-Host -noNewline "Trying "
|
Write-Host "Searching for " -noNewline
|
||||||
|
TryEditor "neovim" $path
|
||||||
TryEditor "vim" $path
|
TryEditor "vim" $path
|
||||||
TryEditor "vi" $path
|
TryEditor "vi" $path
|
||||||
TryEditor "nano" $path
|
TryEditor "nano" $path
|
||||||
|
Loading…
Reference in New Issue
Block a user