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:
		
							
								
								
									
										9
									
								
								MultiShop/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								MultiShop/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							@@ -45,6 +45,15 @@
 | 
				
			|||||||
                "run"
 | 
					                "run"
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            "problemMatcher": ["$msCompile"]
 | 
					            "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
 | 
					import shutil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SERVER_DIR = "src/MultiShop/Server"
 | 
					SERVER_DIR = "server"
 | 
				
			||||||
DATA_DIR = "Data"
 | 
					DATA_DIR = "Data"
 | 
				
			||||||
DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}"
 | 
					DB_MIGRATE_CMD = "dotnet ef migrations add InitialCreate -o {0}"
 | 
				
			||||||
DB_UPDATE_CMD = "dotnet ef database update"
 | 
					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.path.dirname(os.path.realpath(__file__)))
 | 
				
			||||||
    os.chdir(os.pardir)
 | 
					    os.chdir(os.pardir)
 | 
				
			||||||
    os.chdir(path)
 | 
					    os.chdir(path)
 | 
				
			||||||
    print("Executing \"{0}\" in \"{1}\".".format(cmd, path))
 | 
					 | 
				
			||||||
    proc = None
 | 
					    proc = None
 | 
				
			||||||
    if (not silent):
 | 
					    if (not silent):
 | 
				
			||||||
 | 
					        print("Executing \"{0}\" in \"{1}\".".format(cmd, path))
 | 
				
			||||||
        proc = await asyncio.create_subprocess_shell(cmd)
 | 
					        proc = await asyncio.create_subprocess_shell(cmd)
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        print("Executing in silent mode.")
 | 
					        print("Executing \"{0}\" in \"{1}\" silently.".format(cmd, path))
 | 
				
			||||||
        proc = await asyncio.create_subprocess_shell(cmd, stdout=devnull)
 | 
					        proc = await asyncio.create_subprocess_shell(cmd, stdout=devnull)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await proc.wait()
 | 
					    await proc.wait()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user