mirror of
https://github.com/flameshikari/outline-ru.git
synced 2026-06-13 12:15:15 +03:00
daa7561aff
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
* bump outline to 1.0.0-2 * update translation.json * update readme.* * update Dockerfile* * bump outline to 1.0.0-test8 * reorganize repo, add git hook * bump version to 1.0.0 * update translations
32 lines
763 B
Python
Executable File
32 lines
763 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import re
|
|
import json
|
|
|
|
ignore = '0.71.0'
|
|
|
|
def resolve(path):
|
|
basepath = os.path.abspath(os.path.dirname(__file__))
|
|
abspath = os.path.abspath(basepath + '/' + path)
|
|
return abspath
|
|
|
|
def get_version(path):
|
|
with open(path, 'r') as f:
|
|
data = json.load(f)
|
|
return data.get('version', None)
|
|
|
|
def replace_version(path, version):
|
|
with open(path, 'r') as file:
|
|
content = file.read()
|
|
pattern = re.compile(r'(\d+\.\d+\.\d+(-\w+)?)')
|
|
|
|
check = lambda x: ignore if ignore == x.group(0) else version
|
|
|
|
with open(path, 'w') as file:
|
|
file.write(pattern.sub(check, content))
|
|
|
|
version = get_version(resolve('../../outline/package.json'))
|
|
|
|
replace_version(resolve('../../README.md'), version)
|