Skip to content

Commit

Permalink
🦄feat: 自动打包
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassianvale committed Jan 26, 2024
1 parent 3cbd981 commit 318aff8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pyinstaller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

import subprocess
import shutil
import os


def package_scripts():

scripts = ['task_scheduler.py', 'backup.py']

for script in scripts:
command = ['pyinstaller', '--onefile', script]
subprocess.run(command)

shutil.copy('config.ini', 'dist')

if os.path.exists('palworld-python-script.zip'):
os.remove('palworld-python-script.zip')

shutil.make_archive('palworld-python-script', 'zip', 'dist')


if __name__ == '__main__':
package_scripts()
print("palworld-python-script 打包成功!")

0 comments on commit 318aff8

Please sign in to comment.