This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-25
Channels
- # announcements (4)
- # asami (26)
- # babashka (82)
- # beginners (27)
- # biff (6)
- # boot (1)
- # calva (42)
- # cider (2)
- # clj-commons (1)
- # clj-http-lite (2)
- # clj-kondo (37)
- # cljdoc (1)
- # clojure (46)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (2)
- # clojurescript (54)
- # code-reviews (18)
- # cursive (2)
- # datalevin (32)
- # datomic (7)
- # etaoin (1)
- # fulcro (9)
- # gratitude (3)
- # hyperfiddle (15)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (32)
- # nrepl (1)
- # off-topic (18)
- # pathom (17)
- # pedestal (5)
- # polylith (89)
- # reitit (7)
- # releases (3)
- # remote-jobs (4)
- # shadow-cljs (52)
- # spacemacs (3)
- # squint (14)
- # tools-build (10)
- # tools-deps (18)
- # vim (4)
- # xtdb (34)
Javascript doesn't have classpaths. And currently I ran into an issue where I want to have two different execution modes of my app and if I merely install/uninstall one dependency I can run either the first, or the second part of the app (one or the other doesn't work) 😄 (this is enabled by autolinking in react native. When I install a specific package then the native app starts to expect things that I don't want it to expect.)
I’m trying to remember a command, but I’ve gone blank.
Traditionally, when starting a script I would use #!/bin/sh
or maybe #!/bin/bash
. If I’m using another language, then it might be #!/bin/python
.
But I know there is a command that will find the correct interpreter to run instead of using a hard coded path like this (at least, I believe I’ve seen it on macos). Can anyone recall the name of it for me, please?
I think env just looks for the program in your path, but at least on linux, you don't need to specify the full path in the shebang, and it will use the your path to find the interpreter anyway
I wrote a python script, and in trying to add the #!
at the top, I realized that my MacOS has it at: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
Well, that isn’t portable. I figured that using env
to find it would be much better. I just couldn’t recall the name
is there no softlink in /bin/
or equivalent that points to that python3? I thought that’s usually how it worked
it's quite common to have multiple python versions installed and activate one by prepending the PATH
or pipenv
generally causes less headache these days
my system has neither of these. I know that package managers makes these things easy to install, but I’m presuming that the people I’m giving the file to won’t have them, and I’d rather not ask that they install something extra if it can be avoided
I use virtualenv
for my python things. But it's possible that you want to run your script without additional wrappers :thinking_face:
If you use virtualenv
then env
would give you the python that you want because you hardcode it via virtualenv
:thinking_face:
But that's an additional step though