How to automatically install all dependencies using apm?


#1

If package A depends on package B, is it possible to automatically install B when installing A using apm?

For example, if I install linter package with apm,

atom tells me that it depends on linter-ui-default, and show me panel for installing it.

I want to do this only using apm, or at least without having to execute atom.

How can I achieve this?


#2

apm install runs anything that npm install runs, so you might be able to use a script in package.json to send an apm command to download the required packages. You should advertise that you’re doing this, because some people might not enjoy having extra packages added. If you do it just through APM, you also run the risk of the user deleting that required dependency. linter will ask for linter-ui-default again if you uninstall the latter.


#3

I guess your answer applies to package developer.

Is there any way I can do similar thing as a user?

For example, if I execute apt-get install gcc, all dependencies for gcc is installed.

Similarly, I’d like to install linter-ui-default, which is dependency of linter, by executing apm install linter --some-option.


#4

You used the #packages category. Check out its description.

Is there any way I can do similar thing as a user?

Like apt-get, the target string accepts multiple entries in one command. You can use apm install linter linter-ui-default to install both linter and its dependency at once. If you want to really get fancy, you could write a script that manages the download and installation of the first package, then takes a look inside its package.json and downloads any entries in package-deps.


#5

I’m really sorry about that. I should’ve read description more carefully. I changed category to #support.

That’s exactly what I was looking for, and maybe I should write a new script.
I wonder why this feature wasn’t implemented on apm though.