发布于2020-04-07

此批处理能够将插件同时更新至GitHub以及Steam Workshop

@ECHO OFF

set WORKDIR=%~dp0
::此处改成插件Git目录
set WORKSPACE=D:\Addon
::此处改为GMOD的bin目录路径
set GMOD_BIN=D:\Steam\steamapps\common\GarrysMod\bin
::此处改为物品的Steam Workshop ID
set ITEM_ID=1800442580

title Garry's Mod Addon Updater

set /p COMMIT_MESSAGE="Commit Message:"

echo Publishing to GitHub...
cd %WORKSPACE%
git add .
::如果不需要签名去除下面的-S
git commit -S -m "%COMMIT_MESSAGE%"
git push
echo Success
echo Publish to Steam Workshop
cd %GMOD_BIN%
gmad create -folder %WORKSPACE% -out publish_addon.gma
gmpublish update -id %ITEM_ID% -addon publish_addon.gma -changes "%COMMIT_MESSAGE%"
echo Success
echo Done!
cd %WORKDIR%

标签: Garry's Mod, Batch

添加新评论