1
0
mirror of https://github.com/DSPBluePrints/FactoryBluePrints.git synced 2025-12-09 10:33:30 +08:00

新增makefile,可以自动化打包

This commit is contained in:
bWFuanVzYWth
2023-03-31 22:49:45 +08:00
parent 7f73395b93
commit cf49be54e3
4 changed files with 24 additions and 63 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
MinGit/
7-zip/
*.log

11
Makefile Normal file
View File

@@ -0,0 +1,11 @@
7Z = ./7-Zip/7z.exe
GIT = ./MinGit/cmd/git.exe
FactoryBluePrints.7z: .git 双击更新蓝图仓库.bat MinGit/ 7-Zip/
$(GIT) pull origin main
$(GIT) push origin main
$(GIT) gc --aggressive --prune=now
$(7Z) a -ms -mx=9 $@ $^
clear:
rm FactoryBluePrints.7z

View File

@@ -62,51 +62,7 @@ Just double click: `双击更新蓝图仓库.bat`
> Q: 为什么我打不开蓝图仓库主页 / 下载特别慢 / 更新特别慢?<br>
Why can't I open the homepage of the blueprint warehouse / the download is very slow / the update is very slow?
> A: 通常是网络问题。蓝图仓库被托管在github上可以通过在[Watt Toolkit](https://steampp.net)(原名steam++)中开启github加速服务解决。~~或者魔法?~~ <br>
A: Usually a network problem. The blueprint warehouse is hosted on github, which can be resolved by enabling the github acceleration service in [Watt Toolkit](https://steampp.net) (formerly known as steam++). ~~ Or magic? ~~
<!--
### 以下内容已过时,出于信息完整性考虑暂不删除,但是已经隐藏
### 视频教程
内容同下方的文字教程视频时长约1.5min
https://www.bilibili.com/video/bv1RK411Z7b2
---
### 文字教程
#### 基础用法
您可以直接进入[蓝图仓库的网页](https://github.com/DSPBluePrints/FactoryBluePrints),寻找并打开自己需要的蓝图文件,点击位于蓝图代码右上方的**全选复制**(Copy raw contents)。
然后进入游戏,在蓝图页面依次点击**新建空蓝图****粘贴****保存更改**,就可以将蓝图代码保存到本地,像平常那样使用。
> 常见问题:
> Q: 为什么蓝图仓库网页打开特别慢,我该怎么办?
> A: 蓝图仓库被托管在github上可以通过在[Watt Toolkit](https://steampp.net)(原名steam++)中开启github加速服务解决。~~或者魔法?~~
#### 进阶用法
如果您有[Git](https://git-scm.com/)的使用基础,**可以将整个蓝图仓库用`clone`命令拉取到游戏的蓝图文件夹内**。这样您将以蓝图合集的形式将完整的蓝图仓库下载到本地,并且可以在游戏内直接访问,享受在线蓝图仓库与游戏无缝衔接的体验。
```cmd
git clone https://github.com/DSPBluePrints/FactoryBluePrints.git
```
> 常见问题:
> Q: `error: SSL_read` 相关
> A: 通常是网络波动,重试即可。如果已经排除网络问题可以搜索 `git SSL_read` 并逐一排查错误原因,此处不再赘述
除非你真的非常清楚你正在做什么,否则请不要手动修改`.git`文件夹内的任何文件,这可能导致以后的自动更新出错
可以通过`pull`命令进行对本地蓝图文件夹进行更新。Git将自动检查上次更新以来发生变动的蓝图/蓝图合集,并以增量更新的形式更新本地仓库
**或者直接双击仓库根目录下的"双击更新蓝图仓库.bat"**
```cmd
git pull origin main
```
-->
A: Usually a network problem. The blueprint warehouse is hosted on github, which can be resolved by enabling the github acceleration service in [Watt Toolkit](https://steampp.net) (formerly known as steam++). ~~Or magic?~~
---

View File

@@ -9,6 +9,7 @@ echo ---->>%LOG_PATH%
echo INF: %date% %time% Start>>%LOG_PATH%
::find git
if exist ".\MinGit\cmd\git.exe" (
set GIT_PATH=.\MinGit\cmd\git.exe
echo INF: %date% %time% GIT_PATH=MinGit>>%LOG_PATH%
@@ -21,31 +22,23 @@ echo WAR: %date% %time% Git/MinGit no found>>%LOG_PATH%
set GIT_PATH=git
)
if exist ".\.git" (
echo INF: %date% %time% ".git" found>>%LOG_PATH%
goto git_init
) else (
echo 警告:没有找到.git文件夹 | Warning: No .git folder found
echo WAR: %date% %time% ".git" no found>>%LOG_PATH%
goto git_no_init
::init
if not exist ".\.gitignore" (
%GIT_PATH% reset --hard
)
:git_no_init
echo 正在尝试重建.git | Trying to rebuild .git
echo INF: %date% %time% ".git" init start>>%LOG_PATH%
%GIT_PATH% init
%GIT_PATH% branch -M main
%GIT_PATH% remote add origin https://github.com/DSPBluePrints/FactoryBluePrints.git
echo INF: %date% %time% ".git" init end>>%LOG_PATH%
:git_init
::update
echo INF: %date% %time% git pull start>>%LOG_PATH%
git config core.longpaths true
set GIT_SSL_NO_VERIFY=true
%GIT_PATH% pull origin main
echo INF: %date% %time% git pull end>>%LOG_PATH%
set git_pull_errorlevel = %errorlevel%
echo INF: %date% %time% git pull exit: %git_pull_errorlevel%>>%LOG_PATH%
if %git_pull_errorlevel% NEQ 0(
echo 错误更新失败这通常是网络问题。请重试或者开加速器再更新。详见README.md
)
:end
::end
echo INF: %date% %time% Exit>>%LOG_PATH%
pause
exit