Skip to content

allow create_package(".") as a special case? #1866

Open

Description

@kevinushey

For example, if I try to run this inside a folder I just created, I see:

> usethis::create_package(".")
New project 'example' is nested inside an existing project './', which is rarely a good idea.
If this is unexpected, the here package has a function, `here::dr_here()` that reveals why './' is regarded as a project.
Error: User input required, but session is not interactive.
Query: Do you want to create anyway?
Execution halted

The warning message isn't quite accurate, but usethis infers the project as already existing because the .git directory exists (even though that's the only thing in the directory).

A more general reprex from the shell:

cd $(mktemp -d)
mkdir .git
R --vanilla -s -e 'usethis::create_package(".")'

Activity

  1. added
    feature
    on Nov 3, 2023
  2. hadley commented on Nov 3, 2023

    @hadley
    Member

    Yeah, that seems like a reasonable idea to me.

  3. added this to the Backlog milestone on Jul 30, 2025
  4. dmenne commented on Mar 3, 2026

    @dmenne

    My use case: Quarto project, with R helper functions I want to put in a package.

    What is the alternative? Claude.ai thinks this is a good idea, but Claude is not the creator of usethis.

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

    description 📚feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions