From 50e84af838525f8604bf8368fbbfc20d7bf6edc4 Mon Sep 17 00:00:00 2001
From: codeboss <2422523675@qq.com>
Date: Mon, 29 Jul 2024 12:41:56 +0800
Subject: [PATCH] update
---
.idea/workspace.xml | 15 +--------------
manage/NovelManage.py | 14 ++++++++++++--
manage/wnss.bat | 10 ++++++++++
3 files changed, 23 insertions(+), 16 deletions(-)
create mode 100644 manage/wnss.bat
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 34bddbc..41e0e9f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,8 +7,6 @@
-
-
@@ -41,7 +39,7 @@
"Python.CompareWindow.executor": "Run",
"Python.MergeView.executor": "Run",
"Python.MileStone.executor": "Run",
- "Python.NovelManage.executor": "Debug",
+ "Python.NovelManage.executor": "Run",
"Python.ReferView.executor": "Run",
"Python.StoryMap.executor": "Run",
"Python.ast_load.executor": "Debug",
@@ -198,15 +196,4 @@
-
-
-
-
- file://$PROJECT_DIR$/manage/NovelManage.py
- 25
-
-
-
-
-
\ No newline at end of file
diff --git a/manage/NovelManage.py b/manage/NovelManage.py
index 7f79613..a8d679b 100644
--- a/manage/NovelManage.py
+++ b/manage/NovelManage.py
@@ -6,7 +6,6 @@ from typing import List
def git_save(target_dir: str):
retls = xsub.run("git status", shell=True, capture_output=True)
- print(retls.stdout)
outlist = str(retls.stdout).split(r'\n')
has_changed:bool = False
@@ -14,6 +13,7 @@ def git_save(target_dir: str):
for o in outlist:
modified_flag = r"\tmodified:"
new_flag = r"\tnew file:"
+ delete_flag = r"\tdeleted:"
if o.startswith(modified_flag):
has_changed = True
files_path.append(o[len(modified_flag):])
@@ -22,14 +22,24 @@ def git_save(target_dir: str):
has_changed = True
files_path.append(o[len(new_flag):])
+ elif o.startswith(delete_flag):
+ has_changed = True
+ files_path.append(o[len(delete_flag):])
+
if has_changed:
xsub.run(f"git add {" ".join(files_path)}", shell=True)
xsub.run(f"git commit -m 'save-at:{time.time()}'")
+def nsc_compile(target_dir: str):
+ retls = xsub.run("nsc --path ./ --dest E:/", shell=True)
+
+
if __name__ == "__main__":
print(sys.argv)
cmd_line = ":".join(sys.argv[1:])
+
#wnss:-cmp
if cmd_line == "wnss:-cmp":
- git_save(os.getcwd())
\ No newline at end of file
+ git_save(os.getcwd())
+ nsc_compile(os.getcwd())
\ No newline at end of file
diff --git a/manage/wnss.bat b/manage/wnss.bat
new file mode 100644
index 0000000..5a7081c
--- /dev/null
+++ b/manage/wnss.bat
@@ -0,0 +1,10 @@
+@echo off
+for %%i in (%0) do (
+ set "FolderPath=%%~dpi"
+)
+
+set "ScriptName=NovelManage.py"
+set ScriptPath=%FolderPath%%ScriptName%
+
+@echo on
+python %ScriptPath% wnss -cmp
\ No newline at end of file