Skip to content

Instantly share code, notes, and snippets.

@RStankov
Created August 16, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RStankov/04bce66902393f43158ed8d8df483caf to your computer and use it in GitHub Desktop.
Save RStankov/04bce66902393f43158ed8d8df483caf to your computer and use it in GitHub Desktop.
data = `yarn outdated`
data = data.split("\n")
index = data.find_index { |line| line =~ /^Package.*Current.*/ }
if index.nil?
print "No new dependancies\n"
exit
end
data = data[(index+1)..-2]
data = data.map do |line|
chunks = line.split(/ +/)
"#{chunks[0]}@#{chunks[3]}"
end
data = data.join ' '
print "yarn upgrade #{data}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment