Skip to content

Commit

Permalink
fix(node): stop when yarn is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Apr 18, 2021
1 parent 016d981 commit 1f25cd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/segment_node.go
Expand Up @@ -49,6 +49,7 @@ func (n *node) loadContext() {
}
if n.language.env.hasFiles("yarn.lock") {
n.packageManagerIcon = n.language.props.getString(YarnIcon, " \uF61A")
return
}
if n.language.env.hasFiles("package-lock.json") || n.language.env.hasFiles("package.json") {
n.packageManagerIcon = n.language.props.getString(NPMIcon, " \uE71E")
Expand Down
1 change: 1 addition & 0 deletions src/segment_node_test.go
Expand Up @@ -49,6 +49,7 @@ func TestNodeInContext(t *testing.T) {
{Case: "npm", hasNPM: true, ExpectedString: "npm", PkgMgrEnabled: true},
{Case: "default", hasDefault: true, ExpectedString: "npm", PkgMgrEnabled: true},
{Case: "disabled", HasYarn: true, ExpectedString: "", PkgMgrEnabled: false},
{Case: "yarn and npm", HasYarn: true, hasNPM: true, ExpectedString: "yarn", PkgMgrEnabled: true},
}

for _, tc := range cases {
Expand Down

0 comments on commit 1f25cd4

Please sign in to comment.