1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-01 08:03:02 +00:00

Update version schema - now have version number

and build number.
This commit is contained in:
Calvin Rose
2018-12-08 14:17:03 -05:00
parent 043f61ef7a
commit 16e514b351
6 changed files with 25 additions and 16 deletions

View File

@@ -779,6 +779,8 @@ JanetTable *janet_core_env(void) {
/* Platform detection */
janet_def(env, "janet/version", janet_cstringv(JANET_VERSION),
"The version number of the running janet program.");
janet_def(env, "janet/build", janet_cstringv(JANET_BUILD),
"The build identifier of the running janet program.");
/* Set as gc root */
janet_gcroot(janet_wrap_table(env));

View File

@@ -29,8 +29,10 @@ extern "C" {
/***** START SECTION CONFIG *****/
#ifndef JANET_VERSION
#define JANET_VERSION "0.0.0 alpha"
#define JANET_VERSION "0.0.0"
#ifndef JANET_BUILD
#define JANET_BUILD "local"
#endif
/*

View File

@@ -23,7 +23,7 @@
-- Stop handling options`)
(os/exit 0)
1)
"v" (fn [&] (print janet/version) (os/exit 0) 1)
"v" (fn [&] (print janet/version "-" janet/build) (os/exit 0) 1)
"s" (fn [&] (:= *raw-stdin* true) (:= *should-repl* true) 1)
"r" (fn [&] (:= *should-repl* true) 1)
"p" (fn [&] (:= *exit-on-error* false) 1)
@@ -53,7 +53,7 @@
(if *raw-stdin*
(repl nil identity)
(do
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose"))
(print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
(repl (fn [buf p]
(def [line] (parser/where p))
(def prompt (string "janet:" line ":" (parser/state p) "> "))

View File

@@ -1,5 +1,5 @@
# Copyright 2017-2018 (C) Calvin Rose
(print (string "Janet " janet/version " Copyright (C) 2017-2018 Calvin Rose"))
(print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2018 Calvin Rose"))
(fiber/new (fn webrepl []
(repl (fn get-line [buf p]