Skip to content

Commit

Permalink
Make new banner with version info a bit less crowded.
Browse files Browse the repository at this point in the history
               _
   _       _ _(_)_     |
  (_)     | (_) (_)    |  A fresh approach to technical computing.
   _ _   _| |_  __ _   |  Version 0 (pre-release)
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Commit 8ac33c1 (2011-08-06 15:45:18)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |
  • Loading branch information
StefanKarpinski committed Aug 6, 2011
1 parent 8ac33c1 commit 4db0d49
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0 (pre-release)
2 changes: 1 addition & 1 deletion j/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/pcre_h.j
/sys.ji
/version.j
8 changes: 5 additions & 3 deletions j/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ JULIAHOME = $(shell pwd)/..
include ../Make.inc

PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+
COMMITVER=$(shell git log -1 | head -n1 | cut -b8-47)
COMMITDATE=$(shell git log -1 | head -n3 | tail -n1 | cut -b 9-50)

JULIA_VERSION=$(shell cat ../VERSION)
COMMIT_HASH=$(shell git log -1 --pretty=format:%H)
COMMIT_DATE=$(shell git log -1 --pretty=format:%ct | xargs perl -MPOSIX=strftime -le 'print strftime "%F %T", gmtime $$ARGV[0]')

all: pcre_h.j version.j

pcre_h.j:
cpp -dM $(EXTROOT)/include/pcre.h | perl -nle '/^\s*#define\s+(PCRE\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "$$1 = $$2"' | sort > $@

version.j:
echo "version() = (0.5, \"$(COMMITVER)\", \"$(COMMITDATE)\")" > version.j
echo "VERSION = (\"$(JULIA_VERSION)\", \"$(COMMIT_HASH)\", \"$(COMMIT_DATE)\")" > version.j

clean:
rm -f pcre_h.j version.j
9 changes: 4 additions & 5 deletions j/client.j
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ function color_available()
false
end

jl_version_string = strcat("Version ", version()[1], " (pre-release)")
jl_commit_string = strcat("Commit ", version()[2])
jl_commit_date = version()[3]
jl_version_string = "Version $(VERSION[1])"
jl_commit_string = "Commit $(VERSION[2][1:10]) ($(VERSION[3]))"

jl_banner_plain =
L" _
Expand All @@ -108,7 +107,7 @@ L" _
_ _ _| |_ __ _ | $jl_version_string
| | | | | | |/ _` | |
| | |_| | | | (_| | | $jl_commit_string
_/ |\__'_|_|_|\__'_| | $jl_commit_date
_/ |\__'_|_|_|\__'_| |
|__/ |

"
Expand All @@ -127,7 +126,7 @@ jl_banner_color =
$(jl)_ _ _| |_ __ _$(tx) | $jl_version_string
$(jl)| | | | | | |/ _` |$(tx) |
$(jl)| | |_| | | | (_| |$(tx) | $jl_commit_string
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $jl_commit_date
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) |
$(jl)|__/$(tx) |

\033[0m"
Expand Down

0 comments on commit 4db0d49

Please sign in to comment.