Skip to content

Commit

Permalink
Use npm view package version, fix ensure=>latest bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Garboden committed Jan 25, 2016
1 parent 1f4a56a commit 6ab073d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/puppet/provider/package/npm.rb
Expand Up @@ -51,15 +51,10 @@ def query
end

def latest
if /#{resource[:name]}@([\d\.]+)/ =~ npm('outdated', '--global', resource[:name])
@latest = Regexp.last_match(1)
else
@property_hash[:ensure] unless @property_hash[:ensure].is_a? Symbol
end
npm('view', resource[:name], 'version').strip
end

def update
resource[:ensure] = @latest
install
end

Expand Down

0 comments on commit 6ab073d

Please sign in to comment.