Closed tesaunders closed 1 year ago
Oh this is interesting! For context, this is coming from a check that enforces that we never initialize lessons using the "master" branch. I did not account for the fact that it was possible to have two init.defaultBranch
statements in git config (which is why the error says 'length = 2' in coercion to 'logical(1)'
Can you give me the output of this command? It will tell me what default branches you have listed so that I can confirm my model of the situation is correct.
cfg <- gert::git_config_global()
cfg$value[cfg$name == "init.defaultbranch"]
In the meantime, I will add a patch to fix this based on my current model and report back when it's ready.
I have a solution ready in #517 for you to test out.
You can install it by using either {pak} or {remotes}:
# VIA PAK -----------------------------------
# install.packages("pak")
pak::pkg_install("carpentries/sandpaper#517")
# ===== OR ======
# VIA REMOTES -------------------------------
# install.packages("remotes")
remotes::install_github("carpentries/sandpaper#517")
Thank you for the speedy reply! Ah yes this makes sense now. I added 'main' as a default branch:
> cfg <- gert::git_config_global()
> cfg$value[cfg$name == "init.defaultbranch"]
[1] "master" "main"
After installing RTools:
> pak::pkg_install("carpentries/sandpaper#517")
✔ Loading metadata database ... done
→ Will update 1 package.
→ Will download 1 package with unknown size.
+ sandpaper 0.13.1 → 0.13.1.9000 [bld][cmp][dl] (GitHub: c4ed1bd)
? Do you want to continue (Y/n) y
ℹ Getting 1 pkg with unknown size
✔ Cached copy of sandpaper 0.13.1.9000 (source) is the latest build
✔ No downloads needed, all packages are cached
ℹ Building sandpaper 0.13.1.9000
✔ Built sandpaper 0.13.1.9000 (10.3s)
✔ Installed sandpaper 0.13.1.9000 (github::carpentries/sandpaper@c4ed1bd) (164ms)
✔ 1 pkg + 78 deps: kept 66, upd 1 [25.1s]
The installation now works:
> sandpaper::create_lesson(tmp, open = FALSE)
ℹ No schedule set, using Rmd files in episodes/ directory.
→ To remove this message, define your schedule in config.yaml or use `set_episodes()` to generate it.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
ℹ To save this configuration, use
set_episodes(path = path, order = ep, write = TRUE)
✔ First episode created in C:/Users/Tom/AppData/Local/Temp/RtmpCel3wZ/file450826bc3fa2/episodes/introduction.Rmd
✔ Setting active project to 'C:/Users/Tom/AppData/Local/Temp/RtmpCel3wZ/file450826bc3fa2'
✔ Writing 'file450826bc3fa2.Rproj'
✔ Adding '.Rproj.user' to '.gitignore'
✔ Setting active project to '<no active project>'
ℹ Workflows up-to-date!
✔ Lesson successfully created in C:/Users/Tom/AppData/Local/Temp/RtmpCel3wZ/file450826bc3fa2
C:/Users/Tom/AppData/Local/Temp/RtmpCel3wZ/file450826bc3fa2
> sandpaper::build_lesson(tmp, preview = FALSE, quiet = TRUE)
> fs::dir_tree(tmp, recurse = 1)
C:\Users\Tom\AppData\Local\Temp\RtmpCel3wZ\file450826bc3fa2
├── CODE_OF_CONDUCT.md
├── config.yaml
├── CONTRIBUTING.md
├── episodes
│ ├── data
│ ├── fig
│ ├── files
│ └── introduction.Rmd
├── file450826bc3fa2.Rproj
├── index.md
├── instructors
│ └── instructor-notes.md
├── learners
│ ├── reference.md
│ └── setup.md
├── LICENSE.md
├── links.md
├── profiles
│ └── learner-profiles.md
├── README.md
└── site
├── built
├── DESCRIPTION
├── docs
├── README.md
└── _pkgdown.yaml
Is it appropriate for me to close this now or is that something you do? (New to this)
Wunderbar! I will close this and will hopefully have the patch available on the universe by EOD
Hi, see output below when following the Install Test.
Output of sessionInfo():