Updated scripts and registered tasks.
reset_db.py now has the updated path. Added reset database to tasks. watch_all.py has improved output.
This commit is contained in:
parent
8b29c6f999
commit
e953c52092
9
MultiShop/.vscode/tasks.json
vendored
9
MultiShop/.vscode/tasks.json
vendored
@ -45,6 +45,15 @@
|
||||
"run"
|
||||
],
|
||||
"problemMatcher": ["$msCompile"]
|
||||
},
|
||||
{
|
||||
"label": "reset database",
|
||||
"command": "py",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"${workspaceFolder}/scripts/reset_db.py"
|
||||
],
|
||||
"problemMatcher": ["$msCompile"]
|
||||
}
|
||||
]
|
||||
}
|
@ -2,7 +2,7 @@ import os
|
||||
import shutil
|
||||
|
||||
|
||||
SERVER_DIR = "src/MultiShop/Server"
|
||||
SERVER_DIR = "server"
|
||||
DATA_DIR = "Data"
|
||||
DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}"
|
||||
DB_UPDATE_CMD = "dotnet ef database update"
|
||||
|
@ -10,12 +10,12 @@ async def exec(cmd, path, silent=False):
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.chdir(os.pardir)
|
||||
os.chdir(path)
|
||||
print("Executing \"{0}\" in \"{1}\".".format(cmd, path))
|
||||
proc = None
|
||||
if (not silent):
|
||||
print("Executing \"{0}\" in \"{1}\".".format(cmd, path))
|
||||
proc = await asyncio.create_subprocess_shell(cmd)
|
||||
else:
|
||||
print("Executing in silent mode.")
|
||||
print("Executing \"{0}\" in \"{1}\" silently.".format(cmd, path))
|
||||
proc = await asyncio.create_subprocess_shell(cmd, stdout=devnull)
|
||||
|
||||
await proc.wait()
|
||||
|
Loading…
Reference in New Issue
Block a user