Skip to content

add Desktop confused by existing local directory with name of registered package #1941

@mgkuhn

Description

@mgkuhn

I registered a package called Desktop.jl (provides portable functions for basic GUI Desktop interactions, namely checking for presence of GUI desktop, as well as opening URLs and files).

With hindsight that particular package name turned out to be a slightly problematic, because Pkg can get confused by the directory Desktop that many users have in their home directory:

$ cd ~
$ ls -d Desktop
Desktop
$ julia
(@v1.5) pkg> add Desktop
[ Info: Resolving package identifier `Desktop` as a directory at `~/Desktop`.
ERROR: Did not find a git repository at `Desktop`

(@v1.5) pkg> 

I found three alternative workarounds:

  • change the current working directory to one that does not contain a subdirectory whose name collides with that of the registered package to be added
  • use ] add Desktop.jl instead of ] add Desktop
  • use Pkg.add("Desktop") instead of ] add Desktop

I was surprised that ] add Desktop behaved differently from Pkg.add("Desktop").

Perhaps it should ignore subdirectories in the current working directory that lack a Project.toml file or a .git subdirectory, just output a warning that it ignored that directory, and then move on to search the registry?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions