diff --git a/cat_osc.json b/cat_osc.json index 0f2d7a8..e166bae 100644 --- a/cat_osc.json +++ b/cat_osc.json @@ -10,7 +10,6 @@ "src/patched_osc.lua" ], - "version_file" : "version.txt", "version_template_file" : "src/version.tmpl.lua", "header_prefix" : "--[ ", diff --git a/cat_server.json b/cat_server.json index afca89e..86d7657 100644 --- a/cat_server.json +++ b/cat_server.json @@ -8,9 +8,8 @@ "src/thumbnailer_server.lua" ], - "version_file" : "version.txt", "version_template_file" : "src/version.tmpl.lua", "header_prefix" : "--[ ", "header_suffix" : " ]--" -} \ No newline at end of file +} diff --git a/concat_files.py b/concat_files.py index d2084fa..0ac878d 100755 --- a/concat_files.py +++ b/concat_files.py @@ -243,9 +243,11 @@ def _create_version_metafile(config, config_dirname): try: git_branch = subprocess.check_output(['git', '-C', repo_dir, 'symbolic-ref', '--short', '-q', 'HEAD'], stderr=subprocess.DEVNULL).decode().strip() git_commit = subprocess.check_output(['git', '-C', repo_dir, 'rev-parse', '--short', '-q', 'HEAD'], stderr=subprocess.DEVNULL).decode().strip() + git_tag = subprocess.check_output(['git', '-C', repo_dir, 'describe', '--tags', '--abbrev=0'], stderr=subprocess.DEVNULL).decode().strip() except: git_branch = None git_commit = None + git_tag = None if not git_branch: git_branch = 'unknown' @@ -255,15 +257,11 @@ def _create_version_metafile(config, config_dirname): else: git_commit = git_commit_short = 'unknown' - project_version_file = config.get('version_file') - if project_version_file: - with open(project_version_file, 'r') as in_file: - project_version = in_file.read().strip() - else: - project_version = 'unknown' + if not git_tag: + git_tag = 'unknown' template_data = { - 'version' : project_version, + 'version' : git_tag, 'branch' : git_branch, 'commit' : git_commit, @@ -352,4 +350,3 @@ def _print_change_writes(source_to_target, target_to_source): file_watcher.get_changes() time.sleep(0.25) - diff --git a/version.txt b/version.txt deleted file mode 100644 index 6f2743d..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.4.4