From 492ac956ca1abbb7918c5a592b6f595398254e9c Mon Sep 17 00:00:00 2001 From: Matt Hernandez Date: Sun, 23 Feb 2014 18:07:25 -0500 Subject: [PATCH] Fixes. Fixed the WriteEnv usage and updated to allow for sudo if necessary. --- pkg/plugin/deploy/modulus.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/plugin/deploy/modulus.go b/pkg/plugin/deploy/modulus.go index 192fccef..4f016e76 100644 --- a/pkg/plugin/deploy/modulus.go +++ b/pkg/plugin/deploy/modulus.go @@ -11,10 +11,11 @@ type Modulus struct { } func (m *Modulus) Write(f *buildfile.Buildfile) { - f.writeEnv("MODULUS_TOKEN", m.Token) + f.WriteEnv("MODULUS_TOKEN", m.Token) // Install the Modulus command line interface then deploy the configured // project. - f.WriteCmdSilent("npm install -g modulus") + f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g modulus") + f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g modulus") f.WriteCmd(fmt.Sprintf("modulus deploy -p '%s'", m.App)) }