added package_json_version

This commit is contained in:
Robert Kiel
2018-08-31 13:43:54 -04:00
committed by GitHub
parent 35b68dadf2
commit b606a6a9b6

View File

@@ -32,6 +32,16 @@ module Shared
end
end
def package_json_version (default_value)
if File.exist? 'package.json'
package_json = File.read('package.json')
json = JSON.parse(package_json)
json['version']
else
default_value
end
end
def git_add (path)
run_cmd "git add #{path}"
end