Skip to content

Commit

Permalink
Remove setNpm method
Browse files Browse the repository at this point in the history
It seems we don't need this anymore anyway

Fixes #63
  • Loading branch information
markelog committed Dec 18, 2017
1 parent 95135c3 commit 7e7b7ca
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
8 changes: 0 additions & 8 deletions bin/ec/main_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ var _ = Describe("node", func() {
Expect(strings.Contains(string(command), "♥ "+secondaryVersion)).To(Equal(true))
})

It("test presence of the npmrc config", func() {
npmrcPath := filepath.Join(variables.Path("node", mainVersion), "/etc/npmrc")

data := io.Read(npmrcPath)

Expect(data).To(Equal("scripts-prepend-node-path=false"))
})

It("should list installed node versions", func() {
Execute("go", "run", path, "node@"+secondaryVersion)
command, _ := Command("go", "run", path, "ls", "node").CombinedOutput()
Expand Down
26 changes: 0 additions & 26 deletions plugins/nodejs/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package nodejs
import (
"fmt"
"net"
"path/filepath"
"regexp"
"runtime"
"strings"
Expand All @@ -13,7 +12,6 @@ import (
"github.com/chuckpreslar/emission"
"github.com/go-errors/errors"

"github.com/markelog/eclectica/io"
"github.com/markelog/eclectica/pkg"
"github.com/markelog/eclectica/plugins/nodejs/modules"
"github.com/markelog/eclectica/variables"
Expand Down Expand Up @@ -51,11 +49,6 @@ func (node Node) Events() *emission.Emitter {
func (node Node) PostInstall() (err error) {
node.Emitter.Emit("post-install")

err = node.setNpm()
if err != nil {
return errors.New(err)
}

ok, err := node.Yarn()
if err != nil && ok == false {
return errors.New(err)
Expand Down Expand Up @@ -136,22 +129,3 @@ func (node Node) ListRemote() ([]string, error) {

return result, nil
}

// Removes needless warnings from npm output
func (node Node) setNpm() (err error) {
path := variables.Path("node", node.Version)
etc := filepath.Join(path, "etc")
npmrc := filepath.Join(etc, "npmrc")

_, err = io.CreateDir(etc)
if err != nil {
return
}

err = io.WriteFile(npmrc, "scripts-prepend-node-path=false")
if err != nil {
return
}

return nil
}

0 comments on commit 7e7b7ca

Please sign in to comment.