Skip to content

Commit

Permalink
ビルドスクリプトを a.b.c_d 型式のバージョン表記に対応
Browse files Browse the repository at this point in the history
  • Loading branch information
hymkor committed Oct 17, 2014
1 parent 8cc7c2d commit 12f6ece
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion make.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

:build
if not exist nyagos.syso windres --output-format=coff -o nyagos.syso nyagos.rc
for /F %%V in ('git log -1 --pretty^=format:%%H') do go build -ldflags "-X main.stamp %DATE% -X main.commit %%V"
for /F %%V in ('git log -1 --pretty^=format:%%H') do go build -ldflags "-X main.stamp %DATE% -X main.commit %%V %VERSION%"
goto end

:release
for /F %%I in (version.txt) do set "VERSION=-X main.version %%I"
goto build

:fmt
for /R . %%I IN (*.go) do go fmt %%I
for /R . %%I in (.*~) do del %%I
Expand Down
3 changes: 3 additions & 0 deletions nyagos.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var rxAnsiEscCode = regexp.MustCompile("\x1b[^a-zA-Z]*[a-zA-Z]")

var stamp string
var commit string
var version string

func main() {
conio.DisableCtrlC()
Expand Down Expand Up @@ -61,6 +62,8 @@ func main() {
L.SetField(-2, "stamp")
L.PushString(commit)
L.SetField(-2, "commit")
L.PushString(version)
L.SetField(-2, "version")
L.Pop(1)
defer L.Close()

Expand Down
6 changes: 4 additions & 2 deletions nyagos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
-- DO NOT EDIT THIS. PLEASE EDIT ~\.nyagos OR ADD SCRIPT INTO nyagos.d\ --
--------------------------------------------------------------------------

print("Nihongo Yet Another GOing Shell")
print("Build at ".. nyagos.stamp .. " with commit "..nyagos.commit)
print("Nihongo Yet Another GOing Shell " .. nyagos.version)
if string.len(nyagos.version) <= 0 then
print("Build at ".. nyagos.stamp .. " with commit "..nyagos.commit)
end
print("Copyright (c) 2014 HAYAMA_Kaoru and NYAOS.ORG")

local function expand(text)
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.0_RC1

0 comments on commit 12f6ece

Please sign in to comment.