Skip to content

Commit 1c7cfdd

Browse files
author
qwe7002
committed
添加文件判断
1 parent 067504e commit 1c7cfdd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

manage.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
from common import file
99

10-
if json.loads(file.read_file("./install/install.lock"))["install"] == "docker":
11-
if not os.environ.get('DOCKER_CONTAINER', False):
12-
args = ""
13-
for arg in sys.argv[1:]:
14-
args = args + " " + arg
15-
os.system("docker run -it --rm -v {0}:/home/silverblog silverblog/silverblog python3 manage.py{1}'".format(
16-
os.getcwd(), args))
17-
exit(0)
10+
if os.path.exists("./install/install.lock"):
11+
if json.loads(file.read_file("./install/install.lock"))["install"] == "docker":
12+
if not os.environ.get('DOCKER_CONTAINER', False):
13+
args = ""
14+
for arg in sys.argv[1:]:
15+
args = args + " " + arg
16+
os.system("docker run -it --rm -v {0}:/home/silverblog silverblog/silverblog python3 manage.py{1}'".format(
17+
os.getcwd(), args))
18+
exit(0)
1819
lang = None
1920
if "LANG" in os.environ:
2021
if "UTF-8" not in os.environ["LANG"] and "UTF.8" not in os.environ["LANG"]:

0 commit comments

Comments
 (0)