diff --git a/src/segment_node.go b/src/segment_node.go index a764fe38..70c411a7 100644 --- a/src/segment_node.go +++ b/src/segment_node.go @@ -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") diff --git a/src/segment_node_test.go b/src/segment_node_test.go index c7bc7206..8cb5b593 100644 --- a/src/segment_node_test.go +++ b/src/segment_node_test.go @@ -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 {