check if version file exists
This commit is contained in:
parent
e2ad2b2737
commit
3d764eb605
4
app.py
4
app.py
@ -69,7 +69,9 @@ def close_connection(exception):
|
||||
|
||||
@app.route('/')
|
||||
def route_index():
|
||||
version = json.load(open('version.json', 'r'))
|
||||
version = None
|
||||
if os.path.isfile('version.json'):
|
||||
version = json.load(open('version.json', 'r'))
|
||||
return render_template('index.html', version=version)
|
||||
|
||||
|
||||
|
@ -56,7 +56,13 @@
|
||||
<body>
|
||||
<div id="assets"></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>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user