0

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?

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
richalot
  • 4,491
  • 7
  • 24
  • 27

2 Answers2

1

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.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • Can you please be more specific? I am in the folder /home/user/dart/dark-sdk/bin/. What am I supposed to type? Thanks for your time. – richalot Dec 20 '14 at 16:46
1

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!

  • Thank you. That worked perfectly. For future users, type in the text exactly, editing only the location of the files. Do NOT replace ${USER} for your user name, and do not change the text ${PATH} or ${DART_SDK} either. I thought I was supposed to replace these with the my own user name, or the actual path, but just type those in exactly as Andreas wrote. – richalot Dec 25 '14 at 07:12