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

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

Open
kevinushey opened this issue Jun 21, 2023 · 1 comment
Open

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

kevinushey opened this issue Jun 21, 2023 · 1 comment
Labels
description 📚 feature a feature request or enhancement

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Jun 21, 2023

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(".")'
@hadley hadley added feature a feature request or enhancement description 📚 labels Nov 3, 2023
@hadley
Copy link
Member

hadley commented Nov 3, 2023

Yeah, that seems like a reasonable idea to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
description 📚 feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants