diff --git a/Packager.py b/Packager.py index c2ec0ef..cab3af7 100644 --- a/Packager.py +++ b/Packager.py @@ -1,6 +1,8 @@ import json import zipfile import os +# 三方输出到剪切板块 +import pyperclip def set_manifest() -> str: @@ -20,12 +22,22 @@ def set_manifest() -> str: data['version'] = input("请输入版本号:") already_edited = True + text_to_copy = f"{data['version']}\n\n{data['description']}\n\n{get_last_changelog(data)}" + pyperclip.copy(text_to_copy) + if already_edited: with open('manifest.json', 'w', encoding='utf-8') as json_file: json.dump(data, json_file, indent=4, ensure_ascii=False) return package_name +def get_last_changelog(data) -> str: + changelog = data['changelog'] + last_changelog = changelog[0] + + result = last_changelog['description'] + return result + def zip_to_package(package_name : str): files_list = [ ".\\css", diff --git a/manifest.json b/manifest.json index 6f4ed4a..fc7a4e5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,48 +1,58 @@ { - "manifest_version": 3, - "name": "B站视频信息", - "package_name": "BiliVideoInfo", - "version": "0.2.0", - "description": "可以预览B站视频信息, 播放量、点赞、投币、收藏、转发、等。", - "icons": { - "128": "img/logo.png" + "manifest_version": 3, + "name": "B站视频信息", + "package_name": "BiliVideoInfo", + "version": "0.2.0", + "description": "可以预览B站视频信息, 播放量、点赞、投币、收藏、转发、等。", + "icons": { + "128": "img/logo.png" + }, + "content_scripts": [ + { + "js": [ + "scripts/content.js", + "scripts/bilibiliAPI.js", + "scripts/md5.js", + "scripts/constants.js", + "scripts/ui.js" + ], + "css": [ + "css/idcard.css" + ], + "matches": [ + "https://*.bilibili.com/*" + ], + "run_at": "document_start" + } + ], + "author": [ + { + "name": "iceriny", + "url": "https://github.com/iceriny" + } + ], + "permissions": [ + "storage" + ], + "web_accessible_resources": [ + { + "resources": [ + "css/idcard.css", + "scripts/markScript.js" + ], + "matches": [ + "https://*.bilibili.com/*" + ] + } + ], + "changelog": [ + { + "description": "完善与优化UI", + "version": "0.2.0" }, - "content_scripts": [ - { - "js": [ - "scripts/content.js", - "scripts/bilibiliAPI.js", - "scripts/md5.js", - "scripts/constants.js", - "scripts/ui.js" - ], - "css": [ - "css/idcard.css" - ], - "matches": [ - "https://*.bilibili.com/*" - ], - "run_at": "document_start" - } - ], - "author": [ - { - "name": "iceriny", - "url": "https://github.com/iceriny" - } - ], - "permissions": [ - "storage" - ], - "web_accessible_resources": [ - { - "resources": [ - "css/idcard.css", - "scripts/markScript.js" - ], - "matches": [ - "https://*.bilibili.com/*" - ] - } - ] + { + "description": "基本功能完成", + "version": "0.1.0" + } + ] } \ No newline at end of file