jacobobryant / biff

A Clojure web framework for solo developers.
https://biffweb.com
MIT License
877 stars 41 forks source link

getting-started new-project doc error on windows #222

Closed milelo closed 2 months ago

milelo commented 3 months ago

from https://biffweb.com/docs/get-started/new-project/

On windows 11 PowerShell:

❯  clj -M -e '(load-string (slurp ""https://biffweb.com/new.clj""))'
Syntax error compiling at (REPL:1:14).
No such namespace: https:

Full report at:
C:\Users\mail\AppData\Local\Temp\clojure-366610206050372560.edn

This work fine:

❯ clj -M -e '(load-string (slurp "https://biffweb.com/new.clj"))'
jacobobryant commented 3 months ago

Interesting--I just tested this on Windows 10 again and I still get the exact reverse behavior. Maybe MS changed the way powershell escaping works in Windows 11? What version of clj are you on/how did you install it? (Not sure it would make any difference, just curious).

If the single-quote works on Windows 11, that sounds great to me--I'd love to only list one command on the create-a-project page anyway. I guess anyone using powershell (on Windows 10 at least?) will hopefully be familiar already with the need to add quotes to clj commands, so if they do run into problems maybe it won't be a big deal anyway. I'll go ahead and update the docs, and if someone opens another issue maybe I'll add a note or something.

milelo commented 2 months ago

Sorry, I must have missed a notification on this. I'm using PowerShell 7.4.5.

I confusingly also have the old "Windows PowerShell" installed as oppose to just "PowerShell". I've tried it and it behaves differently, it works with the command from your doc. I assume that is what you are using.

jacobobryant commented 2 months ago

ah--just did a little googling on that; I didn't even realize there were two different versions of PowerShell. I've updated the website to say that the escaping may be necessary; that oughtta cover all the bases:

clj -M -e '(load-string (slurp "https://biffweb.com/new.clj"))'

# In some versions of PowerShell, you may need to escape the quotes:
clj -M -e '(load-string (slurp ""https://biffweb.com/new.clj""))'