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

create() in existing directory #627

Closed
krlmlr opened this issue Oct 27, 2014 · 5 comments · Fixed by #637
Closed

create() in existing directory #627

krlmlr opened this issue Oct 27, 2014 · 5 comments · Fixed by #637

Comments

@krlmlr
Copy link
Member

krlmlr commented Oct 27, 2014

Desired workflow:

git init new.package
cd new.package
Rscript -e "devtools::create()"

Currently yields:

Creating package new.package in ...
Error: Directory already exists

Suggestion: Creation should silently work when the directory is empty except for a .git subdirectory.

@gaborcsardi
Copy link
Member

This is what I usually do:

Rscript -e 'devtools::create("newpackage")'
cd newpackage
git init .
git add .
git commit -m 'Initial commit, after devtools::create()'
...

This seems to be about the same amount of typing.

@krlmlr
Copy link
Member Author

krlmlr commented Oct 27, 2014

No doubt. It just hurts when you try to do it the other way round. Related: #593.

@mbojan
Copy link

mbojan commented Oct 28, 2014

I think it might be useful, e.g. if you clone an (almost) empty repository to create a package there. For example, when you clone a GitHub repository containing only README.md

@hadley
Copy link
Member

hadley commented Nov 5, 2014

create() is designed to be a first step, not a second. I think you should either adopt the standard devtools workflow, or submit a PR that implements a new function (extracting out most of the code from create()).

@hadley hadley closed this as completed Nov 5, 2014
@krlmlr
Copy link
Member Author

krlmlr commented Nov 5, 2014

Before submitting a PR, I wanted to hear opinions. Personally, I think that tools should adopt to workflows, not the other way round.

I'd like to look further into this issue. What would be a good name for the new function?

hadley added a commit that referenced this issue Nov 5, 2014
New function `setup()` that works like `create()` but assumes an existing, not necessarily empty, directory.
Fixes #627.
@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants