DEV Community

Discussion on: Introducing AdonisJS - Part 3

Collapse
 
kswope profile image
Kevin Swope • Edited

you cannot have project-specific commands with a global binary

make, rake, etc?

What am I not understanding?

Collapse
 
amanvirk1 profile image
Aman Virk • Edited

They are tasks runner and not command line apps that ships with their own set of commands. Plus there are many other subtle things. For example:

The task code itself doesn't rely on (or import) anything from rake itself. Whereas with ace commands, your very first import is a BaseCommand from ace itself

Collapse
 
kswope profile image
Kevin Swope

So the rails command is a task runner too?

guides.rubyonrails.org/command_lin...

rails console
rails server
rails test
rails generate
rails db:migrate
rails db:create
rails routes
rails dbconsole
rails new app_name
Enter fullscreen mode Exit fullscreen mode

None of those commands require ruby be called directly on the command line. What is ace doing that I'm missing?

Thread Thread
 
amanvirk1 profile image
Aman Virk

Your comments feels like "lets see if I can begin a fight". I am more than happy, if you can suggest an alternative way to have project specific commands by installing a global binary.

Once you suggest an implementation. We both can together go through the merits and de-merits of your implementation and mine and happy to choose yours if it stands out :)

Thread Thread
 
kswope profile image
Kevin Swope

You wrote in bold text "you cannot have project-specific commands with a global binary".

In other words: it is impossible to do this

Being a rails developer I'd been running the "rails" command for years so I was just wondering why this statement was so definitive and I was wondering if ace was doing something rails can't.

Being a developer in general I was wondering why a global node script couldn't just do a cwd and go from there.