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

Error: object 'github' not found #124

Closed
moldach opened this issue Feb 28, 2019 · 8 comments
Closed

Error: object 'github' not found #124

moldach opened this issue Feb 28, 2019 · 8 comments

Comments

@moldach
Copy link
Contributor

moldach commented Feb 28, 2019

I was about to send a PR for the open = FALSE argument; things were going great for the first three functions but then something went horribly wrong on the fourth one 😭

Obviously, I thought it was a mistake I made in the code. I made sure to delete the local repo and install a-new, then I used lookup::lookup to make sure that I was in fact using code from lockedata/starters. Now all four functions won't work for me!

At first the error was:

Error: Error in 'git2r_remote_add': remote 'origin' already exists

A SO post suggested the following:

git remote -v show
origin  git@github.com:moldach/wellThisSucks.git (fetch)
origin  git@github.com:moldach/wellThisSucks.git (push)

git remote rm origin

I get a new error but not sure how to resolve.

> starters::createBasicProject("brokeGIT2")
New project 'brokeGIT2' is nested inside an existing project './', which is rarely a good idea.
Do you want to create anyway?

1: For sure
2: No way
3: Negative

Selection: 1
✔ Setting active project to '<no active project>'
✔ Setting active project to 'C:/Users/Matthew/Documents/brokeGIT2'
✔ Writing 'DESCRIPTION'
Package: Documents
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
    * Matthew Oldach <moldach686@gmail.com> [aut, cre]
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Language: es
LazyData: true
Can I create directoryC:/Users/Matthew/Documents/brokeGIT2/.checkpointfor internal checkpoint use?

Continue (y/n)? y
✔ Writing 'README.Rmd'
✔ Adding '^README\\.Rmd$' to '.Rbuildignore'
✔ Adding Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. badge to 'README.Rmd'
● Re-knit 'README.Rmd'
Error: object 'github' not found
Oops! An error was found and the `brokeGIT2` directory was deleted
✔ Setting active project to 'C:/Users/Matthew/Documents'
> starters::createBasicProject("IbrokeGIT")
New project 'IbrokeGIT' is nested inside an existing project './', which is rarely a good idea.
Do you want to create anyway?

1: No way
2: Absolutely not
3: For sure

Selection: 3
✔ Setting active project to '<no active project>'
✔ Setting active project to 'C:/Users/Matthew/Documents/IbrokeGIT'
✔ Writing 'DESCRIPTION'
Package: Documents
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
    * Matthew Oldach <moldach686@gmail.com> [aut, cre]
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Language: es
LazyData: true
Can I create directoryC:/Users/Matthew/Documents/IbrokeGIT/.checkpointfor internal checkpoint use?

Continue (y/n)? y
✔ Writing 'README.Rmd'
✔ Adding '^README\\.Rmd$' to '.Rbuildignore'
✔ Adding Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. badge to 'README.Rmd'
● Re-knit 'README.Rmd'
Error: object 'github' not found
Oops! An error was found and the `IbrokeGIT` directory was deleted
✔ Setting active project to 'C:/Users/Matthew/Documents'

using starters::start_here() I see:

Checking GitHub account can be guessed...
✔ Your GitHub username is moldach.
Checking git is installed...
✔ git seems to be installed!
Checking gitconfig...
✔ gitconfig is already set!
Checking GITHUB_PAT...
✔ GITHUB_PAT is already set!
Checking default description values...
✔ DESCRIPTION defaults are already set!
Checking build tools are available...
✔ Build tools are available!
✔ All set now!
@maelle
Copy link
Contributor

maelle commented Feb 28, 2019

Thanks! I was not able to reproduce the bug. Can you try again but not nested inside a project? And I've updated the function a little bit to have the checkpoint stuff at the end, but to be safe and see whether it comes from checkpoint or not, please run createBasicProject("projectname", packagdeps = "none").

@maelle
Copy link
Contributor

maelle commented Feb 28, 2019

What I was able to do is to improve the code creating and resetting projects but it won't solve your problem. 🤔

@moldach
Copy link
Contributor Author

moldach commented Feb 28, 2019 via email

@maelle
Copy link
Contributor

maelle commented Feb 28, 2019

Delete the .rproj/.git that might be at ./, now starters should no longer create those by mistake (I had some bad code for setting /resetting projects that caused this weird issue)

@moldach
Copy link
Contributor Author

moldach commented Mar 3, 2019

There was a .git folder (and .rproj) in ./ and I've deleted them. The other three functions work but I'm presented with a new error from createPackageProject() now:

createPackageProject("packageProjTest")
✔ Creating 'packageProjTest/'
✔ Writing 'DESCRIPTION'
Package: Documents
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
    * Matthew Oldach <moldach686@gmail.com> [aut, cre]
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Language: es
LazyData: true
✔ Writing 'NAMESPACE'
✔ Writing 'Documents.Rproj'
✔ Adding '.Rproj.user' to '.gitignore'
✔ Adding '^Documents\\.Rproj$', '^\\.Rproj\\.user$' to '.Rbuildignore'
✔ Setting active project to '<no active project>'
✔ Setting active project to 'C:/Users/Matthew/Documents/packageProjTest'
✔ Writing 'CODE_OF_CONDUCT.md'
✔ Adding '^CODE_OF_CONDUCT\\.md$' to '.Rbuildignore'
● Don't forget to describe the code of conduct in your README:
  Please note that the 'Documents' project is released with a
  [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
  By contributing to this project, you agree to abide by its terms.
  [Copied to clipboard]
✔ Writing 'LICENSE.md'
✔ Adding '^LICENSE\\.md$' to '.Rbuildignore'
✔ Writing 'LICENSE'
✔ Writing 'R/Documents-package.R'
Error: cannot open the connection
Oops! An error was found and the `packageProjTest` directory was deleted
✔ Setting active project to 'C:/Users/Matthew/Documents'
Warning message:
In cat(lines, file = con, sep = "") :
  cannot open file 'C:/Users/Matthew/Documents/packageProjTest/R/Documents-package.R': No such file or directory

It seems to be still trying to create those (.rproj and .git) in ./

@maelle
Copy link
Contributor

maelle commented Mar 3, 2019

Weird is this due to some restrictions on the file created? I.e no write rights?

@moldach
Copy link
Contributor Author

moldach commented Mar 3, 2019

Hmm strange thing, not sure what I did to fix it but I was doing some work on one of my git repos for a bit and returned to try this again and it magically worked all of a sudden.

I've just made my first PR for the open = FALSE argument

@maelle
Copy link
Contributor

maelle commented Mar 4, 2019

Good, I'll close this issue but of course feel free to open any new issue if you encounter a new problem! And thanks for the PR!

@maelle maelle closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants