增加Makefile
This commit is contained in:
parent
27730075dc
commit
ee2d6477ee
16
Makefile
16
Makefile
|
|
@ -1,6 +1,14 @@
|
||||||
target: dist
|
target: dist build
|
||||||
create-version-file metadata.yml --outfile dist/file_version_info.txt
|
create-version-file metadata.yml --outfile build/file_version_info.txt
|
||||||
pyinstaller -F main.py --version-file dist/file_version_info.txt -n Lightening
|
pyinstaller -F main.py --version-file build/file_version_info.txt -n Lightening
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
mkdir dist
|
mkdir dist
|
||||||
|
|
||||||
|
build:
|
||||||
|
mkdir build
|
||||||
|
|
||||||
|
.PHONY:clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -fr build
|
||||||
4
main.py
4
main.py
|
|
@ -1,4 +1,5 @@
|
||||||
import math
|
import math
|
||||||
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import tomli
|
import tomli
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
@ -27,6 +28,9 @@ def egm():
|
||||||
toml_file_path = r"article.toml"
|
toml_file_path = r"article.toml"
|
||||||
else:
|
else:
|
||||||
toml_file_path = sys.argv[1]
|
toml_file_path = sys.argv[1]
|
||||||
|
if not os.path.exists(toml_file_path):
|
||||||
|
logger.info(f'无法找到数据文件{toml_file_path},程序退出。')
|
||||||
|
sys.exit(0)
|
||||||
logger.info(f"读取文件{toml_file_path}")
|
logger.info(f"读取文件{toml_file_path}")
|
||||||
with open(toml_file_path, "rb") as toml_fs:
|
with open(toml_file_path, "rb") as toml_fs:
|
||||||
toml_dict = tomli.load(toml_fs)
|
toml_dict = tomli.load(toml_fs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue