Last active
August 9, 2016 23:59
-
-
Save ZacCranko/ac505c8db680ba97a9be to your computer and use it in GitHub Desktop.
Current juliarc.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
push!(LOAD_PATH, pwd()) | |
# Run _init.jl at runtime if it exists | |
if VERSION < v"0.4-" | |
if isinteractive() && isfile("_init.jl") | |
info("Found ", joinpath(pwd(),"_init.jl")) | |
include(joinpath(pwd(),"_init.jl")) | |
end | |
else | |
atreplinit() do repl | |
if isfile("_init.jl") | |
info("Found ", joinpath(pwd(),"_init.jl")) | |
include(joinpath(pwd(),"_init.jl")) | |
end | |
end | |
end | |
# Use macros since it's easier to type @function than function() | |
# Edit this file | |
macro juliarc() | |
edit("~/.juliarc.jl") | |
end | |
# Methods macro | |
macro methods(m) | |
@eval methods($m) | |
end | |
# Run _init.jl if it exists | |
macro init() | |
if isfile("_init.jl") | |
info("Found ", joinpath(pwd(),"_init.jl")) | |
include("_init.jl") | |
else | |
print("_init.jl not found in current directory: $(pwd()). Create one instead? (y/n) ") | |
rl = readline(STDIN) | |
if first(rl) == 'y' | |
edit("_init.jl") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment