🚑 Fix docker make data folder

This commit is contained in:
xtaodada 2023-12-12 23:42:02 +08:00
parent 81f895ecce
commit 8fb39b1e2e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 5 additions and 1 deletions

View File

@ -1,10 +1,13 @@
from pathlib import Path from pathlib import Path
data = Path("data")
data.mkdir(exist_ok=True)
def rename(old: Path): def rename(old: Path):
if old.exists(): if old.exists():
old_file_name = old.name old_file_name = old.name
new = Path("data") / old_file_name new = data / old_file_name
if new.exists(): if new.exists():
new.unlink() new.unlink()
old.rename(new) old.rename(new)

View File

@ -57,6 +57,7 @@ login () {
main () { main () {
cd /pagermaid/workdir || exit cd /pagermaid/workdir || exit
mkdir -p /pagermaid/workdir/data
if [ -f "/pagermaid/workdir/install.lock" ]; then if [ -f "/pagermaid/workdir/install.lock" ]; then
echo "Hello world!" > /pagermaid/workdir/data/install.lock echo "Hello world!" > /pagermaid/workdir/data/install.lock
fi fi