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

Comments

Projects
None yet
4 participants
@krlmlr
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

This comment has been minimized.

Member

gaborcsardi commented Oct 27, 2014

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

This comment has been minimized.

Member

krlmlr commented Oct 27, 2014

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

@mbojan

This comment has been minimized.

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

This comment has been minimized.

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 Nov 5, 2014

@krlmlr

This comment has been minimized.

Member

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

Merge pull request #637 from krlmlr/627-setup-package
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.