Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg3: relative paths for adding local packages #31

Open
djsegal opened this issue Mar 2, 2017 · 3 comments
Open

Pkg3: relative paths for adding local packages #31

djsegal opened this issue Mar 2, 2017 · 3 comments
Labels

Comments

@djsegal
Copy link

djsegal commented Mar 2, 2017

So you can do,

Pkg.add("UTF64", "~/code/UTF64.jl")


edit:

i know you can just keep monkeying around with ~/.julia/v0.5/UTF64, it just feels a little dirty

@ararslan ararslan added the Pkg3 label Mar 3, 2017
@djsegal
Copy link
Author

djsegal commented Jul 17, 2017

That second param could probably be a keyword argument under the name "path"

Along with others like:

  • Github
  • Branch
  • Version

@rofinn
Copy link

rofinn commented Jul 17, 2017

Yeah, I do this enough that I've just added the following to my juliarc.

using FilePaths

function Base.Pkg.add(path::AbstractPath)
    extension(path) == "jl" || throw(ArgumentError("Expected pkg directory to end with '.jl'"))
    pkg_name = filename(path)
    pkg_dir = Path(Pkg.dir(pkg_name))
        
    Pkg.clone(String(path))
    remove(pkg_dir; recursive=true)
    symlink(path, pkg_dir)
end

@tkelman
Copy link

tkelman commented Jul 18, 2017

You can clone from filesystem-local repositories already, though it does make a copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants