[F] Fix script
This commit is contained in:
parent
42421bc57d
commit
bf60e4265b
1 changed files with 9 additions and 2 deletions
|
|
@ -52,7 +52,14 @@ def edit_versions(version: str):
|
||||||
content = [f"VERSION = '{version}'" if l.startswith('VERSION = ') else l for l in path.read_text().split('\n')]
|
content = [f"VERSION = '{version}'" if l.startswith('VERSION = ') else l for l in path.read_text().split('\n')]
|
||||||
path.write_text('\n'.join(content))
|
path.write_text('\n'.join(content))
|
||||||
|
|
||||||
# 3. README.md
|
# 3. Cargo.toml
|
||||||
|
print('Editing Cargo.toml...')
|
||||||
|
path = Path('Cargo.toml')
|
||||||
|
content = path.read_text()
|
||||||
|
content = re.sub(r'(?<=^version = ")[^"]+(?="$)', version, content)
|
||||||
|
path.write_text(content)
|
||||||
|
|
||||||
|
# 4. README.md
|
||||||
print('Editing README.md...')
|
print('Editing README.md...')
|
||||||
path = Path('README.md')
|
path = Path('README.md')
|
||||||
content = path.read_text()
|
content = path.read_text()
|
||||||
|
|
@ -61,7 +68,7 @@ def edit_versions(version: str):
|
||||||
content = content[:changelog_i] + f'\n\n### {version}' + content[changelog_i:]
|
content = content[:changelog_i] + f'\n\n### {version}' + content[changelog_i:]
|
||||||
path.write_text(content)
|
path.write_text(content)
|
||||||
|
|
||||||
# 4. neofetch script
|
# 5. neofetch script
|
||||||
print('Editing neofetch...')
|
print('Editing neofetch...')
|
||||||
path = Path('neofetch')
|
path = Path('neofetch')
|
||||||
lines = path.read_text().replace("\t", " ").split('\n')
|
lines = path.read_text().replace("\t", " ").split('\n')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue