Check to make sure editor is real
This commit is contained in:
parent
8403352a02
commit
06f6128a83
8
koans.tm
8
koans.tm
@ -148,8 +148,8 @@ func main(clean=no -> Abort):
|
|||||||
":print()
|
":print()
|
||||||
|
|
||||||
if clean:
|
if clean:
|
||||||
(./editor.txt):remove()
|
(./editor.txt):remove(ignore_missing=yes)
|
||||||
(./lessons):remove()
|
(./lessons):remove(ignore_missing=yes)
|
||||||
|
|
||||||
if (./editor.txt):exists():
|
if (./editor.txt):exists():
|
||||||
editor = (./editor.txt):read()!
|
editor = (./editor.txt):read()!
|
||||||
@ -158,7 +158,9 @@ func main(clean=no -> Abort):
|
|||||||
|
|
||||||
":print()
|
":print()
|
||||||
else:
|
else:
|
||||||
editor = ask("What command line text editor do you want to use? ")!
|
editor = ask("What command line text editor do you want to use? ") or goodbye()
|
||||||
|
while editor == "" or not $Shell"command -v $editor >/dev/null":run():succeeded():
|
||||||
|
editor = ask("I don't recognize that editor. Try again? ") or goodbye()
|
||||||
(./editor.txt):write(editor)
|
(./editor.txt):write(editor)
|
||||||
$Colorful"
|
$Colorful"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user