elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

elm-repl derps in read-only directories #138

Open bukzor opened 7 years ago

bukzor commented 7 years ago

A demonstration:

$ cd /
$ elm-repl
---- elm-repl 0.18.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> 1
elm-repl: repl-temp-000.elm: openFile: permission denied (Permission denied)

If this were a bash script, I'd use one of ${TMPDIR:-/tmp} or $(mktemp -d). Surely there's a haskell package that gives you a cross-platform tmpdir.

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

bukzor commented 7 years ago

I think this is what you want:

https://hackage.haskell.org/package/temporary-1.2.0.4/docs/System-IO-Temp.html#v:withSystemTempDirectory