summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-22 08:27:04 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-22 08:40:49 +0300
commit24574aef2299925c10eeb9d20a942f36d1d806d4 (patch)
treee05affad9e645047bddee6a93ca69e11445f50fa /src/bin
parent3f68ce4a8e9b295a4b9fc288174f166e229da8b0 (diff)
downloadbumper-rs-24574aef2299925c10eeb9d20a942f36d1d806d4.tar.gz
feat: use project's name in git tag template
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/bumper.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bin/bumper.rs b/src/bin/bumper.rs
index fb5194a..9fbf898 100644
--- a/src/bin/bumper.rs
+++ b/src/bin/bumper.rs
@@ -21,7 +21,14 @@ fn bumper() -> Result<(), BumperError> {
let cwd = abspath(".")?;
println!("Setting version for project in {}", cwd.display());
- for mut kind in ProjectKind::detect(&cwd)? {
+
+ let mut kinds = ProjectKind::detect(&cwd)?;
+ if kinds.is_empty() {
+ return Err(BumperError::UnknownProjectKind(cwd));
+ }
+ let name = kinds[0].name()?;
+
+ for kind in kinds.iter_mut() {
let version = kind.set_version(&opt.version)?;
println!("{} project set to {}", kind.desc(), version);
}
@@ -30,7 +37,7 @@ fn bumper() -> Result<(), BumperError> {
git::commit(".", &msg)?;
let tag = Tag::new(&opt.tag)?;
- let tag = tag.apply("", &opt.version);
+ let tag = tag.apply(&name, &opt.version);
println!("release tag: {}", tag);
git::tag(".", &tag, &msg)?;
debug!("Bumper ends OK");