update dev.sh

This commit is contained in:
锦恢 2025-04-14 12:42:40 +08:00
parent 200a53fafc
commit 4e8caf4c53
2 changed files with 14 additions and 26 deletions

23
dev.ps1
View File

@ -1,16 +1,7 @@
# 定义颜色变量 npx concurrently `
$PINK = "$([char]27)[33m" -n "renderer,service" `
$GREEN = "$([char]27)[32m" -p " {name} " `
$NC = "$([char]27)[0m" -c "black.bgBlue,black.bgGreen" `
--kill-others `
Start-Job -ScriptBlock { "cd renderer && npm run serve" `
cd renderer "cd service && npm run serve"
npm run serve | ForEach-Object { "$using:PINK[renderer]$using:NC $_" }
}
Start-Job -ScriptBlock {
cd service
npm run serve | ForEach-Object { "$using:GREEN[service]$using:NC $_" }
}
Get-Job | Wait-Job | Receive-Job -Wait

17
dev.sh
View File

@ -1,12 +1,9 @@
#!/bin/bash #!/bin/bash
# 定义颜色变量(使用 -e 选项的 echo 时) npx concurrently \
PINK=$'\033[33m' -n "renderer,service" \
GREEN=$'\033[32m' -p " {name} " \
NC=$'\033[0m' -c "black.bgBlue,black.bgGreen" \
--kill-others \
(cd renderer && npm run serve | while read -r line; do echo -e "${PINK}[renderer]${NC} $line"; done) & "cd renderer && npm run serve" \
"cd service && npm run serve"
(cd service && npm run serve | while read -r line; do echo -e "${GREEN}[service]${NC} $line"; done) &
wait