mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-13 07:17:12 +03:00
Move version strings to build script
This commit is contained in:
parent
5fce875399
commit
7a70e7b35b
15
build.py
15
build.py
@ -8,6 +8,10 @@ import os
|
||||
import distutils.dir_util
|
||||
|
||||
|
||||
VERSION_SHORT = "BETA v.9"
|
||||
VERSION_FULL = VERSION_SHORT + ", released 19 Sep 2018"
|
||||
|
||||
|
||||
EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
||||
EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
||||
EXEC_YUI = "java -jar lib/yuicompressor-2.4.8.jar --charset utf-8 --line-break 160 --type css -o \"{1}\" \"{0}\""
|
||||
@ -42,7 +46,7 @@ with open("reserve.txt", "r") as reserved:
|
||||
def combine_files(input_pattern, output_file):
|
||||
with fileinput.input(sorted(glob.glob(input_pattern))) as stream:
|
||||
for line in stream:
|
||||
output_file.write(line)
|
||||
output_file.write(line.replace("{{{version:full}}}", VERSION_FULL))
|
||||
|
||||
|
||||
def build_tracker_html():
|
||||
@ -88,7 +92,7 @@ def build_tracker_userscript():
|
||||
userscript_base = "src/base/track.user.js"
|
||||
|
||||
with open(userscript_base, "r") as base:
|
||||
userscript_contents = base.read().split("{{{contents}}}")
|
||||
userscript_contents = base.read().replace("{{{version}}}", VERSION_SHORT).split("{{{contents}}}")
|
||||
|
||||
with open(output_file, "w") as out:
|
||||
out.write(userscript_contents[0])
|
||||
@ -156,6 +160,13 @@ def build_website():
|
||||
web_style_file = "bld/web/style.css"
|
||||
|
||||
distutils.dir_util.copy_tree("web", "bld/web")
|
||||
index_file = "bld/web/index.php"
|
||||
|
||||
with open(index_file, "r") as index:
|
||||
index_contents = index.read()
|
||||
|
||||
with open(index_file, "w") as index:
|
||||
index.write(index_contents.replace("{{{version:web}}}", VERSION_SHORT.replace(" ", " ")))
|
||||
|
||||
os.makedirs("bld/web/build", exist_ok = True)
|
||||
shutil.copyfile(tracker_file_html, "bld/web/build/track.html")
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name Discord History Tracker
|
||||
// @version BETA v.9
|
||||
// @version {{{version}}}
|
||||
// @license MIT
|
||||
// @namespace https://chylex.com
|
||||
// @homepageURL https://dht.chylex.com/
|
||||
|
@ -51,7 +51,7 @@ var GUI = (function(){
|
||||
|
||||
showModal(560, `
|
||||
<p>Discord History Tracker is developed by <a href='https://chylex.com'>chylex</a> as an <a href='${linkGH}/blob/master/LICENSE.md'>open source</a> project.</p>
|
||||
<sub>BETA v.9, released 19 Sep 2018</sub>
|
||||
<sub>{{{version:full}}}</sub>
|
||||
<p>Please, report any issues and suggestions to the <a href='${linkGH}/issues'>tracker</a>. If you want to support the development, please spread the word and consider <ref='https://www.patreon.com/chylex'>becoming a patron</a>. Any support is appreciated!</p>
|
||||
<p><a href='${linkGH}/issues'>Issue Tracker</a> — <a href='${linkGH}'>GitHub Repository</a> — <a href='https://twitter.com/chylexmc'>Developer's Twitter</a></p>`);
|
||||
};
|
||||
|
@ -223,7 +223,7 @@ ${radio("asm", "pause", "Pause Tracking")}
|
||||
${radio("asm", "switch", "Switch to Next Channel")}
|
||||
<p id='dht-cfg-note'>
|
||||
It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br>
|
||||
<sub>BETA v.9, released 19 Sep 2018</sub>
|
||||
<sub>{{{version:full}}}</sub>
|
||||
</p>`);
|
||||
|
||||
// elements
|
||||
|
@ -13,7 +13,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="inner">
|
||||
<h1>Discord History Tracker <span class="version">BETA v.9</span> <span class="bar">|</span> <span class="notes"><a href="https://github.com/chylex/Discord-History-Tracker/wiki/Release-Notes">Release Notes</a></span></h1>
|
||||
<h1>Discord History Tracker <span class="version">{{{version:web}}}</span> <span class="bar">|</span> <span class="notes"><a href="https://github.com/chylex/Discord-History-Tracker/wiki/Release-Notes">Release Notes</a></span></h1>
|
||||
<p>Discord History Tracker is a browser script that lets you locally save chat history in your servers, groups, and private conversations.</p>
|
||||
<p>When the script is active, it will load history of the selected text channel up to the first message, and let you download it for offline viewing in your browser.</p>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user