View source: R/api-bump-version.R
bump_version | R Documentation |
Calls the following functions:
Verify that the current branch is the main branch
if check_default_branch = TRUE
(the default).
update_news()
, using the which
argument, applying logic to determine
if meaningful changes have been made since the last version.
From the result, check if there were meaningful changes since the last version.
Depending on the which
argument:
If "dev"
, finalize_version()
with push = FALSE
Otherwise, commit_version()
.
bump_version(
which = c("dev", "pre-patch", "patch", "pre-minor", "minor", "pre-major", "major"),
...,
no_change_behavior = c("bump", "noop", "fail"),
check_default_branch = TRUE
)
which |
Component of the version number to update. Supported values are
|
... |
These dots are for future extensions and must be empty. |
no_change_behavior |
What to do if there was no change since the last
version: |
check_default_branch |
Whether to check that the current branch is the default branch. |
TRUE
if NEWS.md
and DESCRIPTION
have been updated,
FALSE
otherwise.
Do not rely on this behavior.
Have you just run bump_version()
, then realized
"oh shoot, I forgot to merge that PR"?
Fear not, run unbump_version()
, merge that PR, run bump_version()
.
unbump_version()
# Create mock package in a temporary directory.
# Set open to TRUE if you want to play in the mock package.
with_demo_project({
# Use functions as if inside the newly created package project.
# (Or go and actually run code inside the newly created package project!)
# Add a new R file.
usethis::use_r("cool-function", open = FALSE)
# Pretend we added useful code inside it.
# Track the new R file with Git.
gert::git_add("R/cool-function.R")
gert::git_commit("- Add cool function.")
# Bump version with fledge.
fledge::bump_version()
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.