build(Script): Script de lancement projet complet (PS1)
- Utilise Windows Terminal pour ouvrir multiples onglets - Lance le frontend Vue (npm run dev) - Lance automatiquement les services backend (score, quizz, buzzer, session...)
This commit is contained in:
33
Start-FullProject.ps1
Normal file
33
Start-FullProject.ps1
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# Chemins de base
|
||||||
|
$ServicesPath = "$($PSScriptRoot)\VNode\services"
|
||||||
|
$VAppPath = "$($PSScriptRoot)\VApp"
|
||||||
|
|
||||||
|
# Liste des services
|
||||||
|
$JsServices = @(
|
||||||
|
"score-manager.js",
|
||||||
|
"quizz-collector.js",
|
||||||
|
"buzzer-manager.js",
|
||||||
|
"buzzer-watcher.js",
|
||||||
|
"session-manager.js"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Utilisation de -d (startingDirectory) pour wt.exe
|
||||||
|
# Cela évite de faire le Set-Location manuellement
|
||||||
|
$WtArguments = "nt --title VultureGame -d `"$($VAppPath)`" powershell.exe -NoExit -Command `"npm run dev -- --host`""
|
||||||
|
|
||||||
|
# Boucle pour ajouter chaque service
|
||||||
|
foreach ($ServiceName in $JsServices) {
|
||||||
|
# Recherche du fichier
|
||||||
|
$ServiceSearch = Get-ChildItem -Path "$($ServicesPath)" -Filter "$($ServiceName)" -Recurse | Select-Object -First 1
|
||||||
|
|
||||||
|
if ($ServiceSearch) {
|
||||||
|
# On définit le répertoire de travail sur le dossier du script trouvé
|
||||||
|
$Directory = $ServiceSearch.DirectoryName
|
||||||
|
$NodeCommand = "node $($ServiceSearch.FullName)"
|
||||||
|
|
||||||
|
$WtArguments += " `; nt --title $($ServiceName) -d `"$($Directory)`" powershell.exe -NoExit -Command `"$($NodeCommand)`""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Lancement final
|
||||||
|
Start-Process "wt.exe" -ArgumentList $WtArguments
|
||||||
Reference in New Issue
Block a user