version bump
This commit is contained in:
parent
d56d689f98
commit
ef99bb40de
|
@ -19,8 +19,7 @@
|
||||||
//MAXPATHLEN
|
//MAXPATHLEN
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
#define VERSION "0.1"
|
#include "version.h"
|
||||||
|
|
||||||
|
|
||||||
namespace ToolBox {
|
namespace ToolBox {
|
||||||
std::string MacToUnix(const std::string path);
|
std::string MacToUnix(const std::string path);
|
||||||
|
@ -847,6 +846,6 @@ int builtin_aboutbox(Environment &env, const std::vector<std::string> &tokens, c
|
||||||
"| |\n"
|
"| |\n"
|
||||||
"| (c) 2016 Kelvin W Sherlock |\n"
|
"| (c) 2016 Kelvin W Sherlock |\n"
|
||||||
"+--------------------------------------+\n"
|
"+--------------------------------------+\n"
|
||||||
,VERSION);
|
, VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env ruby -w
|
||||||
|
|
||||||
|
# make-version version
|
||||||
|
|
||||||
|
def q(x)
|
||||||
|
# quote a string
|
||||||
|
'"' + x.gsub(/[\"]/, '\\\1' ) + '"'
|
||||||
|
end
|
||||||
|
|
||||||
|
unless ARGV.length == 1
|
||||||
|
puts("Usage: make-version version")
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
VERSION = ARGV[0]
|
||||||
|
|
||||||
|
File.open("version.h", "w") {|f|
|
||||||
|
|
||||||
|
f.puts("#ifndef __version_h__")
|
||||||
|
f.puts("#define __version_h__")
|
||||||
|
f.puts("#define VERSION #{q(VERSION)}")
|
||||||
|
f.puts("#define VERSION_DATE #{q(Time.new.ctime)}")
|
||||||
|
f.puts("#endif")
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = system(*%w(cmake --build build))
|
||||||
|
ok = system(*%w(git add version.h))
|
||||||
|
ok = system(*%w(git commit -m), "Bump Version: #{VERSION}")
|
||||||
|
ok = system(*%w(git tag), "r#{VERSION}")
|
||||||
|
exit 0
|
|
@ -31,6 +31,8 @@
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
namespace fs = filesystem;
|
namespace fs = filesystem;
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,9 +61,9 @@ fs::path root() {
|
||||||
void init(Environment &env) {
|
void init(Environment &env) {
|
||||||
|
|
||||||
env.set("mpw", root());
|
env.set("mpw", root());
|
||||||
env.set("status", std::string("0"));
|
env.set("status", 0);
|
||||||
env.set("exit", std::string("1")); // terminate script on error.
|
env.set("exit", 1); // terminate script on error.
|
||||||
env.set("echo", std::string("1"));
|
env.set("echo", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,8 +114,8 @@ int read_make(phase1 &p1, phase2 &p2, Environment &env, const std::vector<std::s
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
|
|
||||||
env.set("echo", "1");
|
env.set("echo", 1);
|
||||||
env.set("exit", "1");
|
env.set("exit", 1);
|
||||||
|
|
||||||
ok = pipe(out);
|
ok = pipe(out);
|
||||||
if (ok < 0) {
|
if (ok < 0) {
|
||||||
|
@ -255,7 +257,7 @@ void help() {
|
||||||
void define(Environment &env, const std::string &s) {
|
void define(Environment &env, const std::string &s) {
|
||||||
|
|
||||||
auto pos = s.find('=');
|
auto pos = s.find('=');
|
||||||
if (pos == s.npos) env.set(s, "1");
|
if (pos == s.npos) env.set(s, 1);
|
||||||
else {
|
else {
|
||||||
std::string k = s.substr(0, pos);
|
std::string k = s.substr(0, pos);
|
||||||
std::string v = s.substr(pos+1);
|
std::string v = s.substr(pos+1);
|
||||||
|
@ -479,7 +481,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!cflag) fprintf(stdout, "MPW Shell 0.1\n");
|
if (!cflag) fprintf(stdout, "MPW Shell " VERSION "\n");
|
||||||
e.startup(true);
|
e.startup(true);
|
||||||
read_file(p1, root() / "Startup");
|
read_file(p1, root() / "Startup");
|
||||||
e.startup(false);
|
e.startup(false);
|
||||||
|
|
|
@ -117,6 +117,12 @@ namespace {
|
||||||
write data;
|
write data;
|
||||||
}%%
|
}%%
|
||||||
|
|
||||||
|
/*
|
||||||
|
* this is not quite right. dev:std* is a reference to the current output device.
|
||||||
|
* need to move this logic elsewhere.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
machine dev;
|
machine dev;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue