anycable / anycable-rails

AnyCable for Ruby on Rails applications
https://anycable.io
MIT License
499 stars 35 forks source link

Update download_generator.rb to make it work #187

Closed le0pard closed 1 year ago

le0pard commented 1 year ago
$ ./bin/rails g anycable:download --version=1.4.0 --bin-path=./bin/dist
rails: no version found in package 1.4.0

$ ./bin/rails g anycable:download --version=v1.4.0 --bin-path=./bin/dist 
rails: no version found in package v1.4.0

Right now only latest working for generator

palkan commented 1 year ago

Which version of anycable-rails / OS do you use? The command above works as expected in 1.4.0:

$ bundle show anycable-rails

/opt/homebrew/lib/ruby/gems/3.2.0/gems/anycable-rails-1.4.0

$ ./bin/rails g anycable:download --version=1.4.0 --bin-path=./bin/dist

         run  curl -L https://github.com/anycable/anycable-go/releases/download/v1.4.0/anycable-go-darwin-arm64 -o ./bin/dist2/anycable-go from "."
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 28.9M  100 28.9M    0     0  32.8M      0 --:--:-- --:--:-- --:--:-- 32.8M
         run  chmod +x ./bin/dist2/anycable-go from "."
         run  ./bin/dist2/anycable-go -v from "."
1.4.0-45526a5
 --- Litejob detected an exit, cleaning up
 --- Exiting with 0 jobs in flight

$ bin/dist/anycable-go -v
1.4.0-45526a5
le0pard commented 1 year ago

Here what I get on mac os:

✔  bundle show anycable-rails                                                                                 
/Users/leo/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-rails-1.4.0

✔  ./bin/rails g anycable:download --version=1.4.0 --bin-path=./bin/dist
rails: no version found in package 1.4.0
le0pard commented 1 year ago
./bin/rails g anycable:download -- --version=1.4.0 --bin-path=./bin/dist

make it work by adding -- between args