Skip to content

Commit

Permalink
Merge pull request DanielGavin#560 from shizeeg/master
Browse files Browse the repository at this point in the history
Add ols version
  • Loading branch information
DanielGavin authored Jan 2, 2025
2 parents 584f01b + de318f6 commit ab75d57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ then
exit 0
fi

version="$(git describe --tags --abbrev=7)"
version="${version%-*}:${version##*-}"
sed -i "s|VERSION :: .*|VERSION :: \"${version}\"|g" src/main.odin

odin build src/ -show-timings -collection:src=src -out:ols -microarch:native -no-bounds-check -o:speed $@
5 changes: 5 additions & 0 deletions src/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "core:sys/windows"
import "src:common"
import "src:server"

VERSION :: "dev-2024-11-9:g584f01b"

os_read :: proc(handle: rawptr, data: []byte) -> (int, int) {
ptr := cast(^os.Handle)handle
Expand Down Expand Up @@ -101,6 +102,10 @@ end :: proc() {
}

main :: proc() {
if len(os.args) > 1 && os.args[1] == "version" {
fmt.println("ols version", VERSION)
os.exit(0)
}
reader := server.make_reader(os_read, cast(rawptr)&os.stdin)
writer := server.make_writer(os_write, cast(rawptr)&os.stdout)

Expand Down

0 comments on commit ab75d57

Please sign in to comment.