Skip to content

Commit

Permalink
Update OpenProc
Browse files Browse the repository at this point in the history
  • Loading branch information
sneekyfoxx committed Jan 7, 2024
1 parent 866f339 commit 1e25cc7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/OpenProc.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/[os, strutils, strformat]
import ReplaceProc, MarkdownProc
import ReplaceProc

proc sigintHandler() {.noconv.} =
stdout.writeLine("\u001b[2K")
Expand All @@ -19,11 +19,7 @@ proc Open*(Open: string = "", Read: string = "", Write: string = "", Append: str

if Open.len == 0 and Read.len > 0 and Write.len == 0 and Append.len == 0:
if fileExists(expandTilde(Read)):
if Read.endsWith(".md") or Read.endsWith("MARKDOWN"):
fileContents = Markdown(expandTilde(Read))

else:
filecontents = readFile(expandTilde(Read))
filecontents = readFile(expandTilde(Read))
stdout.write(ReplaceProc.Replace(fileContents))
stdout.flushFile
quit(0)
Expand Down

0 comments on commit 1e25cc7

Please sign in to comment.