Skip to content

create() in existing directory #627

Description

@krlmlr

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.

Activity

  1. gaborcsardi commented on Oct 27, 2014

    @gaborcsardi
    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.

  2. krlmlr commented on Oct 27, 2014

    @krlmlr
    MemberAuthor

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

  3. mbojan commented on Oct 28, 2014

    @mbojan

    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

  4. hadley commented on Nov 5, 2014

    @hadley
    Member

    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()).

  5. krlmlr commented on Nov 5, 2014

    @krlmlr
    MemberAuthor

    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?

  6. added a commit that references this issue on Nov 5, 2014
    bd9c252
  7. locked and limited conversation to collaborators on Sep 18, 2018
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions