Skip to content

destdir argument for create_package() and create_project() #1684

Open

Description

@rossellhayes

create_from_github() includes a destdir argument specifying what directory to copy a project into. It also allows you to set a default destdir with options("usethis.destdir").

create_package() and create_project() currently don't have a destdir argument, meaning the user has to type out the full directory path each time they create a new project. If they had a destdir argument, they could use the same usethis.destdir option and users could ensure that their projects are always created in their chosen directory, whether cloned from GitHub or started from scratch.

If this would be helpful, I'd be happy to work on a PR.

Activity

  1. changed the title [-]Feature request: `destdir` argument for `create_package()` and `create_project()`[/-] [+]`destdir` argument for `create_package()` and `create_project()`[/+] on Jan 17, 2023
  2. added
    feature
    on Jan 17, 2023
  3. hadley commented on Jan 17, 2023

    @hadley
    Member

    I'm open to the idea, but I don't see how you can do it without breaking existing usage — create_package("foo") currently will create it in a subdirectory, but if we added destdir, it would add in getOption("destdir").

  4. jennybc commented on Jan 17, 2023

    @jennybc
    Member

    I have contemplated this before and remain positively disposed towards the idea. But yeah it's also not trivial to figure out the interface. Every time I've thought about how I would implement it, I've decided it's easier to just keep doing create_package("~/rrr/whatever").

  5. added this to the Backlog milestone on Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurepaths 🚶‍♂️

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions