Usually you want @__FILE__ not Base.source_path() On Friday, August 1, 2014, Júlio Hoffimann <[email protected]> wrote:
> Anyone? > > Júlio. > Em 31/07/2014 09:44, "Júlio Hoffimann" <[email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>> escreveu: > >> Dear all, >> >> During my attempt to add the GPLv3 license to the pkg system, I thought >> it would be great to improve the maintainability of the module by >> separating the license terms from the actual code. For instance, take the >> MIT license: >> >> srcdir = dirname(Base.source_path()) >> >> mit(pkg::String, years::String, authors::Union(String,Array)) = >> """ >> The $pkg.jl package is licensed under the MIT "Expat" License: >> >> $(copyright(years,authors)) >> >> $(readall(joinpath(srcdir,"license","MIT.txt"))) >> """ >> >> The issue I'm encountering is that the Base.source_path() function is not >> returning the correct string or something. I have two questions: >> >> 1. How to fix the code above assuming the file license/MIT.txt is present >> in the tree. >> >> 2. When we type relative path strings such as "license/MIT.txt" and pass >> them to readall(), shouldn't Julia look into the current path where the >> file resides? >> >> Best, >> Júlio. >> >> P.S.: How do you highlight Julia code in Gmail? >> >
