richalot
richalot

Reputation: 4821

How do you access the command line in Dart Pub package manager

I am trying to explore using Dart's Pub package manager on the command line. Unfortunately, I don't know how to do this, and all the documentation I have read, presupposes that this is known. What are the actual steps needed to set up the command line, so you can run pub commands on GNU/Linux systems?

This is an expansion on this question: link. Can someone please help?

Upvotes: 0

Views: 195

Answers (2)

Andreas Ölund
Andreas Ölund

Reputation: 42

If you're on Linux and you've unpackaged the SDK in /home/$USER/ you should add the SDK PATH to the bottom of your .bashrc.

vim ~/.bashrc

 DART_SDK=/home/${USER}/dart/dart-sdk
 export PATH=${PATH}:${DART_SDK}/bin
 alias DartEditor='/home/${USER}/dart/DartEditor'
 alias dartium='/home/${USER}/dart/chromium/chrome'

You might have to run source ~/.bashrc to have the binaries available in your current console.

Now you should be able to run pub --help and work your way from there. Also you can now open the editor and the dart based chrome from the commandline like this: DartEditor or dartium (add & exit to those command if you don't want the output from those programs).

Good luck!

Upvotes: 1

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657781

You can either add the dart-sdk/bin directory to the path or create symlinks in /usr/bin for the command line tools you want to have available. You can of course just use the full path to the executables.

Upvotes: 1

Related Questions