Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jun 11, 2023
1 parent 1b3247d commit 42a1219
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"siyuanDev": "vue-tsc && vite build --watch",
"siyuanBuild": "vue-tsc && vite build",
"siyuanSync": "cp -r ./dist/* /Users/terwer/Documents/mydocs/SiYuanWorkspace/public/data/plugins/siyuan-plugin-picgo",
"package": "python scripts/package.py",
"preview": "vite preview"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/package.py
Expand Up @@ -14,9 +14,9 @@
v = data["version"]

src_folder = dist_folder
tmp_folder_name = "./siyuan-plugin-kanban-girl"
tmp_folder_name = "./siyuan-plugin-picgo"
build_zip_path = "./build"
build_zip_name = "siyuan-plugin-kanban-girl-" + v + ".zip"
build_zip_name = "siyuan-siyuan-plugin-picgo-" + v + ".zip"

try:
# 压缩dist为zip
Expand Down
26 changes: 24 additions & 2 deletions scripts/parse_changelog.py
@@ -1,5 +1,27 @@
# Copyright (c) 2023, Terwer . All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Terwer designates this
# particular file as subject to the "Classpath" exception as provided
# by Terwer in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
# or visit www.terwer.space if you need additional information or have any
# questions.

import re
import shutil
from collections import defaultdict


Expand Down Expand Up @@ -84,4 +106,4 @@ def remove_same_commit(commit_list):


if __name__ == "__main__":
parse_changelog()
parse_changelog()
9 changes: 5 additions & 4 deletions scripts/scriptutils.py
Expand Up @@ -102,14 +102,13 @@ def rm_files(regex):
rm_file(file)


def cp_folder(src, dst, remove_folder=False):
def cp_folder(src, dst):
"""
拷贝文件夹
:param src: 源文件夹,例如:"/path/to/source/folder"
:param dst: 目的地,例如:"/path/to/destination/folder"
:param remove_folder: 是否删除文件夹
"""
if os.path.exists(dst) and remove_folder:
if os.path.exists(dst):
rm_folder(dst)

if not os.path.exists(dst):
Expand Down Expand Up @@ -188,7 +187,7 @@ def zip_folder(src_folder, tmp_folder_name, build_zip_path, build_zip_name):
rm_folder(tmp_folder_name)


def create_zip(root_path, file_name, ignored=[], storage_path=None):
def create_zip(root_path, file_name, ignored=None, storage_path=None):
"""Create a ZIP
This function creates a ZIP file of the provided root path.
Expand All @@ -201,6 +200,8 @@ def create_zip(root_path, file_name, ignored=[], storage_path=None):
storage_path: If provided, ZIP file will be placed in this location. If None, the
ZIP will be created in root_path
"""
if ignored is None:
ignored = []
if storage_path is not None:
zip_root = os.path.join(storage_path, file_name)
else:
Expand Down
11 changes: 9 additions & 2 deletions scripts/version.py
Expand Up @@ -67,5 +67,12 @@ def parse_json(filename, version_field, new_version):
if args.verbose:
print("Verbose mode enabled")

# plugin.json
parse_json(cwd + "plugin.json", "version", args.version)
# widget.json
parse_json(cwd + "widget.json", "version", args.version)

# manifest.json
parse_json(cwd + "public/manifest.dev.json", "version", args.version)
parse_json(cwd + "public/manifest.prod.json", "version", args.version)

# mv2 manifest.json
parse_json(cwd + "public/mv2/manifest-v2-for-firefox.json", "version", args.version)

0 comments on commit 42a1219

Please sign in to comment.