nitrous-io/goop — pull request #25 by dafang (2014-09-16 04:17:31+00:00)
Title: Add "goop install package" support

## Features from this pull request

By leverage the ```npm``` command, I added the package installation support to ```goop install```, then you can use:

- ```goop install``` to continue install all packages from Goopfile
- ```goop install github.com/revel/revel``` to install one package you specified from the command line
- ```goop install github.com/revel/revel #tag``` to install the package with the specified tag name

And also, there is one new arg supported to the ```install``` command, which is ```--save-dev``` the same as ```npm```,

- ```goop install github.com/revel/revel --save-dev```, the ```goop``` command will install the package ```github.com/revel/revel``` and it will also append the package ```github.com/revel/revel``` to the Goopfile for convenient, or
- ```goop install --save-dev github.com/revel/revel``` the same with ```goop install github.com/revel/revel --save-dev```

## Changes are made

Added the install arg support to the main.go file;

Added one new method ```InstallPkg``` to goop/goop.go file, logic:

- Create one tmp file ".Goopfile" and copy all the packages from "Goopfile" if it exists to ".Goopfile"
- Append the new package to the end of this file
- Call ```g.parseAndInstall(gftmp, true)``` to reuse the original logic to install the new packages in file ".Goopfile"
- If ```--save-dev``` is true, then mv the tmp file ".Goopfile" to "Goopfile"