Skip to content

Commit

Permalink
feat: Version handling
Browse files Browse the repository at this point in the history
  • Loading branch information
akelch committed Nov 8, 2021
1 parent 6098ea4 commit 52e9256
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

This file documents any relevant changes.

## [0.5.0] - 2021-11-08

- first release
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# viur-tools
ViUR related python tools
## ViUR-ClI

The ViUR-Cli project allows the control of ViUR projects from one central location.

### Installation

use pip or pipenv to install this package

```sh
pip install viur-cli
```

### Some Examples

```sh
viur-cli --help
viur-cli init
viur-cli run
viur-cli deploy
viur-cli index
viur-cli vi
viur-cli flare vi watch
viur-cli env
```

### Dependencies

The app server dependents on the following packages

* [click](https://click.palletsprojects.com/)
* [app_server](https://github.com/XeoN-GHMB/app_server)
* [pipfile-requirements](https://github.com/frostming/pipfile-requirements)
* [watchgod](https://github.com/samuelcolvin/watchgod)
* [python-minifier](https://github.com/dflook/python-minifier)

## License

Distributed under the MIT License. See `LICENSE` for more information.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = viur_cli
version = 0.2.0
version = viur_cli.__version__
author = Andreas H. Kelch
author_email = [email protected]
description = A CLI to do everyday tasks
Expand Down
8 changes: 7 additions & 1 deletion src/viur_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
projectConfig = None
projectConfigFilePath = "./project.json"

__version__ = "0.5.0"


@click.group(invoke_without_command=True)
def cli():
@click.option("-v", "--version", is_flag=True)
def cli(version):
"""Info output"""
if version:
click.echo(f"ViUR-CLI {__version__}")
return 0
click.echo("Welcome to ViUR-CLI")
loadConfig()

Expand Down
7 changes: 7 additions & 0 deletions src/viur_cli/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ def env():

click.echo(f"Current Environment:")

# viur-cli
if shutil.which("viur-cli"):
app_server_version = subprocess.check_output(['viur-cli', '-v']).decode("utf-8")
click.echo(f"{valid_icon} {app_server_version}")
else:
click.echo(f"{failed_icon} ViUR-CLI")

# app_server
if shutil.which("app_server"):
app_server_version = subprocess.check_output(['app_server', '-V']).decode("utf-8")
Expand Down

0 comments on commit 52e9256

Please sign in to comment.