mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Only import toml and gitpython when necessary
Allows for using most commands on platforms without git installed (like the a-shell app on ios where gitpython doesnt quite work)
This commit is contained in:
parent
c661be05dc
commit
396960fae0
@ -16,10 +16,8 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import os.path
|
import os.path
|
||||||
from ..cli import cargo_toml
|
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import git
|
|
||||||
|
|
||||||
import yaclog.version
|
import yaclog.version
|
||||||
from yaclog.changelog import Changelog
|
from yaclog.changelog import Changelog
|
||||||
@ -254,10 +252,12 @@ def release(obj: Changelog, version_name, rel_seg, pre_seg, commit, cargo):
|
|||||||
short_version = cur_version.name.replace(' ', '-')
|
short_version = cur_version.name.replace(' ', '-')
|
||||||
|
|
||||||
if cargo:
|
if cargo:
|
||||||
|
from ..cli import cargo_toml
|
||||||
cargo_toml.set_version("Cargo.toml", str(short_version))
|
cargo_toml.set_version("Cargo.toml", str(short_version))
|
||||||
click.echo("Updated Cargo.toml")
|
click.echo("Updated Cargo.toml")
|
||||||
|
|
||||||
if commit:
|
if commit:
|
||||||
|
import git
|
||||||
repo = git.Repo(os.curdir)
|
repo = git.Repo(os.curdir)
|
||||||
|
|
||||||
if repo.bare:
|
if repo.bare:
|
||||||
|
Loading…
Reference in New Issue
Block a user