https://github.com/davidruvolo51/pkgbump
📦 A quick and dirty way to manage and update an R package's version number across multiple files.
https://github.com/davidruvolo51/pkgbump
package-development r r-package rstats
Last synced: about 2 months ago
JSON representation
📦 A quick and dirty way to manage and update an R package's version number across multiple files.
- Host: GitHub
- URL: https://github.com/davidruvolo51/pkgbump
- Owner: davidruvolo51
- License: mit
- Created: 2020-08-17T20:20:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-03T09:26:54.000Z (about 3 years ago)
- Last Synced: 2025-01-13T18:46:10.703Z (3 months ago)
- Topics: package-development, r, r-package, rstats
- Language: R
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - davidruvolo51/pkgbump - 📦 A quick and dirty way to manage and update an R package's version number across multiple files. (R)
README

[](https://github.com/davidruvolo51/pkgbump/actions)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)# pkgbump
A quick and dirty way to update a package's version number across internal files.
## Install
At the moment, `pkgbump` is not available CRAN. Instead, you can install the latest release using the `devtools` or `remotes` packages.
```r
remotes::install_github("davidruvolo51/pkgbump@*release")
```## Use
To use `pkgbump`, use `set_pkgbump` to track files that you would like to managed. This will create a configuration file `.pkgbump.json` in your local project directory. The function `pkgbump` will update the version number in each of these files.
```r
# init configuration file
pkgbump::set_pkgbump(
files = c(
"DESCRIPTION",
"package.json"
)
)# set version number
pkgbump::pkgbump(version = "0.0.1")
```At the moment, this package supports R's `DESCRIPTION` file, `.json` files, and `.R` files. `.json` files are updated using the `jsonlite` package and adding or updating the property `version`. Updating the `DESCRIPTION` file works by finding and updating the entire `Version:` line.
R files are a bit trickier as all instances of `version` could appear in a variety of formats. The default patterns for R files will find and replace all instances `version = "0.0.0"`. You can add your own R search patterns using the `r_patterns` argument in `set_pkgbump`. Please be are that R patterns are passed on to `stringr::str_replace_all()`.
```r
pkgbump::set_pkgbump(
files = c(
"R/my_file.R"
),
r_patterns = "..."
)
```I would recommend creating a package management script in the `dev` directory (see the `dev` directory of this project for an example) and writing the `pkgbump` configuration in that file.
## To Do
- [ ] Detect outdated config files and rebuild
- [ ] Refactor `write` function
- [ ] Refactor `set_pkgbump` function
- [ ] Refactor config file contents and fix timestamps