Created
February 17, 2016 07:38
-
-
Save suhanlee/11a2a8fbdbfd9d2624c8 to your computer and use it in GitHub Desktop.
get version-code and version-name in android's build.grade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
filename = ARGV[0] | |
File.open(filename, 'r').each do |line| | |
versionCode = line.match(/versionCode\s(\d*)/) | |
if versionCode != nil | |
v = versionCode.captures | |
puts v | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
filename = ARGV[0] | |
File.open(filename, 'r').each do |line| | |
versionCode = line.match(/versionName\s"(\S*)"/) | |
if versionCode != nil | |
v = versionCode.captures | |
puts v | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment