Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read version from local .version file #16

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
# Original Repository: https://github.com/eibex/reaction-light
# License: MIT - Copyright 2019-2020 eibex

__version__ = "0.3.0"

directory = os.path.dirname(os.path.realpath(__file__))

with open(f"{directory}/.version") as f:
__version__ = f.read().rstrip("\n").rstrip("\r")

folder = f"{directory}/files"
config = configparser.ConfigParser()
config.read(f"{directory}/config.ini")
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

# Original Repository: https://github.com/eibex/reaction-light
# License: MIT - Copyright 2019-2020 eibex
folder = path.dirname(path.realpath(__file__))
with open(f"{folder}/.version") as f:
__version__ = f.read().rstrip("\n").rstrip("\r")

print("Author: eibex")
print("Version: 0.3.0")
print(f"Version: {__version__}")
print("License: MIT\n")

print("### ### Reaction Light Setup ### ###")
Expand Down Expand Up @@ -68,7 +72,6 @@
else:
break

folder = path.dirname(path.realpath(__file__))
config = configparser.ConfigParser()
config.read("{}/config.ini.sample".format(folder))
config["server"]["token"] = token
Expand Down