wrote bump-version tool for #23
This commit is contained in:
16
projects/bump-version/src/bump_version/Main.kiss
Normal file
16
projects/bump-version/src/bump_version/Main.kiss
Normal file
@@ -0,0 +1,16 @@
|
||||
(defun :Void main []
|
||||
(let [[jsonFile workingDir]
|
||||
(Sys.args)
|
||||
json
|
||||
(Json.parse
|
||||
(File.getContent (joinPath workingDir jsonFile)))
|
||||
oldVersion
|
||||
json.version
|
||||
:kiss.List<Int> versionParts
|
||||
(.map (oldVersion.split ".") Std.parseInt)]
|
||||
(+= (nth versionParts -1) 1)
|
||||
(let [newVersion
|
||||
(versionParts.join ".")]
|
||||
(print "Bumping version of $jsonFile from $oldVersion -> $newVersion")
|
||||
(set json.version newVersion)
|
||||
(File.saveContent (joinPath workingDir jsonFile) (Json.stringify json "\t")))))
|
Reference in New Issue
Block a user