Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayGminx committed Sep 10, 2022
1 parent 3483175 commit 683784e
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
target/
logs/
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

## 使用方式

该应用程序必须要在 Java 32位虚拟机上运行。但是,为了减少繁琐的安装操作,此应用程序已经自带了 Java 32位虚拟机,以及批处理脚本`Worship PPT.bat`
所以你只需要打开`Worship PPT.bat`,按照提示去操作就行了。
该应用程序必须要在 Java 虚拟机上运行。但是,为了减少繁琐的安装操作,此应用程序已经自带了 Java 虚拟机,以及启动脚本。此应用程序分为Windows版和Mac OS版。
Windows版的启动脚本是`worship-ppt.bat`,Mac OS版的启动脚本是`worship-ppt.sh`。你只需要打开启动脚本,按照提示去操作就行了。

该应用程序要求使用 ini 文件来作为输入数据。编辑 ini 文件是使用此应用程序最重要的一个环节。你只需要用 Windows 操作系统的记事本就可以打开编辑了,
不过我更加推荐用 Notepad++ 来编辑,它更加智能。此应用程序已经提供了 ini 文件的模板`input.ini`,该文件已经告诉了你怎么编辑,相信你一定能一看就懂。
Expand Down Expand Up @@ -51,8 +51,4 @@
圣经。

此应用程序默认使用“新标点和合本”,若要使用其它版本的圣经,则要打开`worship-ppt.jar``worship-ppt.properties`核心配置文件,找到`scripture.version`
修改为你想要的版本。

## 下一个版本预告

支持mac os系统
修改为你想要的版本。
21 changes: 0 additions & 21 deletions Worship PPT.bat

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>claygminx</groupId>
<artifactId>worship-ppt</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2</version>

<name>Worship PPT Toolkit</name>
<description>一个用于自动制作敬拜PPT的小工具</description>
Expand Down
38 changes: 34 additions & 4 deletions src/main/java/claygminx/components/impl/UpgradeServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.util.Date;
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static claygminx.common.Dict.General.*;

Expand Down Expand Up @@ -116,20 +118,48 @@ protected ReleaseEntity getThisProjectReleaseEntity() {
}
}

/**
* 从GitHub消息返回体中获取下载地址
* @param body 消息体
* @return 下载地址
*/
protected String getDownloadUrlFromGitHubBody(String body) {
if (body == null) {
return "";
}
String downloadTitle = SystemConfig.getString(GITHUB_DOWNLOAD_TITLE);
String titleLevel = downloadTitle.split(" ")[0];
Pattern titlePattern = Pattern.compile("^[#]+");

String[] strArray = body.split("\r\n");
StringBuilder returnBuilder = new StringBuilder();
int j = strArray.length;
for (int i = 0; i < strArray.length; i++) {
String str = strArray[i];
if (downloadTitle.equals(str)) {
if (i != strArray.length - 1) {
return strArray[i + 1];
if (str.trim().isEmpty()) {
continue;
}
if (i >= j) {// 在“下载地址”的上下文中
Matcher matcher = titlePattern.matcher(str);
if (matcher.find()) {// 是个标题,那么再判断是不是“下载地址”的子标题
String group = matcher.group();
if (group.length() > titleLevel.length()) {// 子标题
returnBuilder.append(str).append('\n');
} else {
break;
}
} else {
returnBuilder.append(str).append('\n');
}
} else if (downloadTitle.equals(str)) {// 开始“下载地址”
j = i + 1;
}
}
return "";

String result = returnBuilder.toString();
if (result.length() > 0 && result.endsWith("\n")) {
result = result.substring(0, result.length() - 1);
}
return result;
}
}
24 changes: 24 additions & 0 deletions worship-ppt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@ECHO OFF

REM 窗口
title Worship PPT Toolkit
color 0F

REM 介绍信息
echo ---------------------------------------------------
echo.
echo 一个用于自动制作主日崇拜PPT的小工具
echo 马克约瑟弟兄出品
echo.
echo ---------------------------------------------------
echo.

REM 先检查升级
echo 正检查升级,请稍等...
"jre\bin\java.exe" -Dfile.encoding=GBK -Drunning.scene=升级 -jar worship-ppt.jar

REM PPT
set /p file_path=请输入带有敬拜数据的ini文件的路径:
"jre\bin\java.exe" -Dfile.encoding=GBK -Drunning.scene=PPT -jar worship-ppt.jar "%file_path%"

echo 辛苦了 φ(゜▽゜*)? & pause>nul
18 changes: 18 additions & 0 deletions worship-ppt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

echo "---------------------------------------------------"
echo ""
echo " 一个用于自动制作主日崇拜PPT的小工具"
echo " 马克约瑟弟兄出品"
echo ""
echo "---------------------------------------------------"

echo ""
echo "正检查升级,请稍等..."
./jre/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Drunning.scene=升级 -jar worship-ppt.jar

read -p "请输入带有敬拜数据的ini文件的路径:" file_path

./jre/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Drunning.scene=PPT -jar worship-ppt.jar $file_path

echo "辛苦了 φ(゜▽゜*)?"

0 comments on commit 683784e

Please sign in to comment.