Generating a new project from empty directory

I’ve cloned an empty repository Test2 from Github. I want to create a Julia package within this folder. After cloning the repository in the following directory C:\Users\someuser\Test2, after accessing it via cd command, I start Julia and then enter the package mode via:

julia> ]

To generate a project within this folder, I type

(@v1.11) pkg> generate Test2
  Generating  project Test2:
    Test2\Project.toml
    Test2\src\Test2.jl

However, another directory Test2 is created with the Project.toml and Manifest.toml files. So the directory now looks like C:\Users\someuser\Test2\Test2. Whereas if I type generate Test2 from C:\Users\someuser directory, I get the following error:

ERROR: C:\Users\someuser\Test2 already exists

How can I create generate the new project files Project.toml and Manifest.toml within the cloned directory at C:\Users\someuser\Test2?

Just move everything below Test2\Test2 up to Test2, then remove the now empty Test2\Test2.

1 Like

Thank you for your reply. So there’s no path-specific information contained in Project.toml and Manifest.toml ? I was apprehensive to do that at first.

There’s not and the absence of paths can easily be verified by inspection.

(@v1.10) pkg> generate Test2
  Generating  project Test2:
    Test2/Project.toml
    Test2/src/Test2.jl

(@v1.10) pkg> 

$ tree Test2
Test2
├── Project.toml
└── src
    └── Test2.jl

1 directory, 2 files

$ cat Test2/Project.toml 
name = "Test2"
uuid = "e99fa0d8-77c6-477a-b44f-3dfec49fa2d1"
authors = ["Gunnar Farnebäck <gunnar@lysator.liu.se>"]
version = "0.1.0"

$ cat Test2/src/Test2.jl 
module Test2

greet() = print("Hello World!")

end # module Test2

The only non-obvious thing is the uuid, which you can think of as a random string with the only purpose of being different from any other uuid out there, so that it can act as a unique identity for the package.