1 Star 0 Fork 0

xiaoshuyui/code-find

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bump_version_script.py 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
guchengxi1994 提交于 2022-04-12 11:44 . feat : add a friends screen
import os
frontend_version_file_path = "./frontend/codind/pubspec.yaml"
backend_version_file_path = "./backend/common/__init__.py"
assert os.path.exists(frontend_version_file_path) and os.path.exists(
backend_version_file_path), "file not found"
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--frontend", help="frontend version")
parser.add_argument("-b", "--backend", help="backend version")
if __name__ == "__main__":
args = parser.parse_args()
# print(args.frontend)
if args.frontend is None and args.backend is None:
print("nothing to do")
if args.frontend is not None:
with open(frontend_version_file_path, "r") as f:
line_list = [line for line in f]
# with open("./frontend/codind/pubspec.yaml.bak",
# "w",
# encoding="utf-8") as fw:
# for i in line_list:
# # print(i)
# fw.write(i)
with open("./frontend/codind/pubspec.yaml",
"w",
encoding="utf-8") as f:
for index in range(0, len(line_list)):
if line_list[index].startswith("version: "):
line_list[index] = "version: " + args.frontend
f.write(line_list[index])
# f.writelines(line_list)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Dart
1
https://gitee.com/guchengxi1994/code-find.git
git@gitee.com:guchengxi1994/code-find.git
guchengxi1994
code-find
code-find
dev

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385