Ejemplo n.º 1
0
func updateNode() {
	registry := node.Registry
	node = gode.NewClient(AppDir)
	node.Registry = registry
	node.NodeVersion = nodeVersion
	node.NpmVersion = npmVersion
	SetupNode()
}
Ejemplo n.º 2
0
	"github.com/heroku/heroku-cli/gode"
)

// Plugin represents a javascript plugin
type Plugin struct {
	Name     string     `json:"name"`
	Version  string     `json:"version"`
	Topics   TopicSet   `json:"topics"`
	Topic    *Topic     `json:"topic"`
	Commands CommandSet `json:"commands"`
}

const nodeVersion = "3.2.0"
const npmVersion = "2.13.3"

var node = gode.NewClient(AppDir)

func init() {
	node.Registry = "https://d1wpeoceq2hoqd.cloudfront.net"
	node.NodeVersion = getLatestInstalledNodeVersion()
	if node.NodeVersion == "" {
		node.NodeVersion = nodeVersion
	}
}

// SetupNode sets up node and npm in ~/.heroku
func SetupNode() {
	if !node.IsSetup() {
		LogIfError(golock.Lock(updateLockPath))
		defer golock.Unlock(updateLockPath)
		if node.IsSetup() {