Commit 3d764eb6 authored by Bui's avatar Bui

check if version file exists

parent e2ad2b27
...@@ -69,6 +69,8 @@ def close_connection(exception): ...@@ -69,6 +69,8 @@ def close_connection(exception):
@app.route('/') @app.route('/')
def route_index(): def route_index():
version = None
if os.path.isfile('version.json'):
version = json.load(open('version.json', 'r')) version = json.load(open('version.json', 'r'))
return render_template('index.html', version=version) return render_template('index.html', version=version)
......
...@@ -56,7 +56,13 @@ ...@@ -56,7 +56,13 @@
<body> <body>
<div id="assets"></div> <div id="assets"></div>
<div id="screen"></div> <div id="screen"></div>
<div id="version"><a href="https://github.com/bui/taiko-web/commit/{{version.commit}}" target="_blank" class="stroke-sub" alt="taiko-web ver.{{version.version}} ({{version.commit_short}})">taiko-web ver.{{version.version}} ({{version.commit_short}})</a></div> <div id="version">
{% if version %}
<a href="https://github.com/bui/taiko-web/commit/{{version.commit}}" target="_blank" class="stroke-sub" alt="taiko-web ver.{{version.version}} ({{version.commit_short}})">taiko-web ver.{{version.version}} ({{version.commit_short}})</a>
{% else %}
<a href="https://github.com/bui/taiko-web" target="_blank" class="stroke-sub" alt="taiko-web (unknown version)">taiko-web (unknown version)</a>
{% endif %}
</div>
<script src="/src/js/main.js?{{version.commit_short}}"></script> <script src="/src/js/main.js?{{version.commit_short}}"></script>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment