Skip to content

Commit e3ea35b

Browse files
committed
Merge pull request #5281 from ivarne/splash-fix
Fix #5218, Compile age in banner
2 parents c2109c3 + 2af2169 commit e3ea35b

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

base/client.jl

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function input_color()
3131
return get(text_colors, c, default_color_input)
3232
end
3333

34-
banner() = print(have_color ? banner_color : banner_plain)
35-
3634
exit(n) = ccall(:jl_exit, Void, (Int32,), n)
3735
exit() = exit(0)
3836
quit() = exit()

base/version.jl

+44-42
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ end
180180

181181
## julia version info
182182

183-
begin
184183
# Include build number if we've got at least some distance from a tag (e.g. a release)
185184
build_number = BUILD_INFO.build_number != 0 ? "+$(BUILD_INFO.build_number)" : ""
186185
try
@@ -190,47 +189,50 @@ catch e
190189
global const VERSION = VersionNumber(0)
191190
end
192191

193-
if BUILD_INFO.tagged_commit
194-
const commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER
195-
elseif BUILD_INFO.commit == ""
196-
const commit_string = ""
197-
else
198-
local days = int(floor((ccall(:clock_now, Float64, ()) - BUILD_INFO.fork_master_timestamp) / (60 * 60 * 24)))
199-
if BUILD_INFO.fork_master_distance == 0
200-
const commit_string = "Commit $(BUILD_INFO.commit_short) ($(days) days old master)"
192+
function banner()
193+
if BUILD_INFO.tagged_commit
194+
commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER
195+
elseif BUILD_INFO.commit == ""
196+
commit_string = ""
201197
else
202-
const commit_string = "$(BUILD_INFO.branch)/$(BUILD_INFO.commit_short) (fork: $(BUILD_INFO.fork_master_distance) commits, $(days) days)"
198+
days = int(floor((ccall(:clock_now, Float64, ()) - BUILD_INFO.fork_master_timestamp) / (60 * 60 * 24)))
199+
if BUILD_INFO.fork_master_distance == 0
200+
commit_string = "Commit $(BUILD_INFO.commit_short) ($(days) days old master)"
201+
else
202+
commit_string = "$(BUILD_INFO.branch)/$(BUILD_INFO.commit_short) (fork: $(BUILD_INFO.fork_master_distance) commits, $(days) days)"
203+
end
204+
end
205+
commit_date = BUILD_INFO.date_string != "" ? " ($(BUILD_INFO.date_string))": ""
206+
207+
if have_color
208+
tx = "\033[0m\033[1m" # text
209+
jl = "\033[0m\033[1m" # julia
210+
d1 = "\033[34m" # first dot
211+
d2 = "\033[31m" # second dot
212+
d3 = "\033[32m" # third dot
213+
d4 = "\033[35m" # fourth dot
214+
215+
print("""\033[1m $(d3)_
216+
$(d1)_ $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
217+
$(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: http://docs.julialang.org
218+
$(jl)_ _ _| |_ __ _$(tx) | Type \"help()\" to list help topics
219+
$(jl)| | | | | | |/ _` |$(tx) |
220+
$(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
221+
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
222+
$(jl)|__/$(tx) | $(Sys.MACHINE)
223+
224+
\033[0m""")
225+
else
226+
print("""
227+
_
228+
_ _ _(_)_ | A fresh approach to technical computing
229+
(_) | (_) (_) | Documentation: http://docs.julialang.org
230+
_ _ _| |_ __ _ | Type \"help()\" to list help topics
231+
| | | | | | |/ _` | |
232+
| | |_| | | | (_| | | Version $(VERSION)$(commit_date)
233+
_/ |\\__'_|_|_|\\__'_| | $(commit_string)
234+
|__/ | $(Sys.MACHINE)
235+
236+
""")
203237
end
204238
end
205-
commit_date = BUILD_INFO.date_string != "" ? " ($(BUILD_INFO.date_string))": ""
206-
207-
const banner_plain =
208-
"""
209-
_
210-
_ _ _(_)_ | A fresh approach to technical computing
211-
(_) | (_) (_) | Documentation: http://docs.julialang.org
212-
_ _ _| |_ __ _ | Type \"help()\" to list help topics
213-
| | | | | | |/ _` | |
214-
| | |_| | | | (_| | | Version $(VERSION)$(commit_date)
215-
_/ |\\__'_|_|_|\\__'_| | $(commit_string)
216-
|__/ | $(Sys.MACHINE)
217-
218-
"""
219-
local tx = "\033[0m\033[1m" # text
220-
local jl = "\033[0m\033[1m" # julia
221-
local d1 = "\033[34m" # first dot
222-
local d2 = "\033[31m" # second dot
223-
local d3 = "\033[32m" # third dot
224-
local d4 = "\033[35m" # fourth dot
225-
const banner_color =
226-
"\033[1m $(d3)_
227-
$(d1)_ $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
228-
$(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: http://docs.julialang.org
229-
$(jl)_ _ _| |_ __ _$(tx) | Type \"help()\" to list help topics
230-
$(jl)| | | | | | |/ _` |$(tx) |
231-
$(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
232-
$(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
233-
$(jl)|__/$(tx) | $(Sys.MACHINE)
234-
235-
\033[0m"
236-
end # begin

0 commit comments

Comments
 (0)