Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bbin install <non raw gist link> does not work #56

Open
chase-lambert opened this issue Mar 3, 2023 · 1 comment
Open

bbin install <non raw gist link> does not work #56

chase-lambert opened this issue Mar 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@chase-lambert
Copy link

bbin install currently does not seem to work with non-raw gist links. It might be a nice convenience feature to add such capability.

I tried to run bbin with a non-raw gist link: bbin install https://gist.github.com/chase-lambert/c5533d8e8fbb71268a25e83ecf8e3cc6 but got the following error:

----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Invalid script coordinates.
If you're trying to install from the filesystem, make sure the path actually exists.
Data:     {:script/lib "https://gist.github.com/chase-lambert/c5533d8e8fbb71268a25e83ecf8e3cc6", :procurer :http, :artifact :unknown-artifact}
Location: /home/chase/.babashka/bbin/bin/bbin:629:11

----- Context ------------------------------------------------------------------
625:           [:local :dir] (install-deps-git-or-local cli-opts' summary)
626:           [:local :file] (install-local-script cli-opts')
627:           [:local :jar] (install-local-jar cli-opts')
628:           [:maven :jar] (install-deps-maven cli-opts')
629:           (throw (ex-info "Invalid script coordinates.\nIf you're trying to install from the filesystem, make sure the path actually exists."
               ^--- Invalid script coordinates.
If you're trying to install from the filesystem, make sure the path actually exists.
630:                           {:script/lib (:script/lib cli-opts')
631:                            :procurer procurer
632:                            :artifact artifact})))))))
633:
634: (defn uninstall [cli-opts]

----- Stack trace --------------------------------------------------------------
babashka.bbin.scripts  - /home/chase/.babashka/bbin/bin/bbin:629:11
babashka.bbin.cli/run  - /home/chase/.babashka/bbin/bin/bbin:657:5
babashka.bbin.cli/run  - /home/chase/.babashka/bbin/bin/bbin:654:1
babashka.bbin.cli      - /home/chase/.babashka/bbin/bin/bbin:671:10
babashka.bbin.cli/bbin - /home/chase/.babashka/bbin/bin/bbin:706:5
babashka.bbin.cli/bbin - /home/chase/.babashka/bbin/bin/bbin:703:1
babashka.bbin.cli      - /home/chase/.babashka/bbin/bin/bbin:709:3
clojure.core/apply     - <built-in>
babashka.bbin.cli      - /home/chase/.babashka/bbin/bin/bbin:713:3
babashka.bbin.cli      - /home/chase/.babashka/bbin/bin/bbin:711:1

Everything worked as expected when I used the raw link: https://gist.githubusercontent.com/chase-lambert/c5533d8e8fbb71268a25e83ecf8e3cc6/raw/9cc7b4208f9bed2609f4736c4f469e1828273af5/chatgpt-cli.clj

@chase-lambert chase-lambert changed the title bin install <non raw gist link> does not work bbin install <non raw gist link> does not work Mar 4, 2023
@rads
Copy link
Collaborator

rads commented Mar 9, 2023

I agree that it would be convenient but the implementation may be tricky. Gists can contain more than one file so there would be some logic needed to handle different cases. This issue is relatively low priority for me to implement myself but PRs are welcome.

@rads rads added the enhancement New feature or request label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants