Skip to content

Commit

Permalink
v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed May 9, 2022
1 parent b1f665e commit 46f6ce6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mcdreforged.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "smart_backup",
"version": "1.4.0",
"version": "1.4.1",
"name": "SmartBackup",
"description": {
"en_us": "A Minecraft Backup Plugin",
Expand Down
9 changes: 7 additions & 2 deletions publisher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ RELEASE=true

while [ -n "$1" ]; do
case $1 in
-n | --no-commit)
-d | --dry-run)
COMMIT=''
RELEASE=''
;;
-C | --no-commit)
COMMIT=''
;;
-R | --no-release)
Expand Down Expand Up @@ -34,12 +38,13 @@ if [ -n "$COMMIT" ]; then
echo '==> Commiting git repo...'
( git add . && git commit -m "$version" && git push ) || exit $?

fi

if [ -n "$RELEASE" ]; then

echo '==> Creating github release...'
gh release create "$version" "./output/${name}.mcdr" -t "$version" -n '' || exit $?

fi
fi

echo '==> Done'
2 changes: 1 addition & 1 deletion smart_backup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import mcdreforged.api.all as MCDR
from .utils import *
from . import globals as GL
from . import commands as CMD
from . import api
from . import commands as CMD

def on_load(server: MCDR.PluginServerInterface, prev_module):
if prev_module is None:
Expand Down
4 changes: 2 additions & 2 deletions smart_backup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def c():
send_message(source, 'Saving backup "{}"'.format(comment), log=True)
backup.save()
send_message(source, 'Saved backup "{}"'.format(comment), log=True)
if GL.SERVER_INS.is_server_running:
if server.is_server_running():
for _ in map(server.execute, GL.Config.after_backup): pass
used_time = time.time() - start_time
broadcast_message('Backup finished, use {0:.2f} sec, {1:}'.format(used_time,
Expand All @@ -122,7 +122,7 @@ def c():
broadcast_message('Backup out of range, automagically cleaning backups...')
swap_job_call(clean_backup)

if not GL.SERVER_INS.is_server_running:
if not server.is_server_running():
c()
elif len(GL.Config.start_backup_trigger_info) > 0:
ping_job()
Expand Down
1 change: 1 addition & 0 deletions smart_backup/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def destory():
global SERVER_INS, Manager
if Config is not None:
Config.save()
Config = None
Manager = None
for c in on_unload_callbacks:
c(SERVER_INS)
Expand Down

0 comments on commit 46f6ce6

Please sign in to comment.