24 lines
504 B
Batchfile
24 lines
504 B
Batchfile
|
@echo off
|
||
|
:: 切换到指定目录
|
||
|
cd /d E:\github.Prj\amis
|
||
|
|
||
|
:: 检查端口8888是否被占用
|
||
|
netstat -an | find "8888" >nul
|
||
|
if %errorlevel% equ 0 (
|
||
|
echo 服务已经在运行
|
||
|
) else (
|
||
|
:: 启动npm并保持窗口打开
|
||
|
start cmd /k "npm start"
|
||
|
|
||
|
:: 等待15秒以确保npm服务器启动
|
||
|
timeout /t 3 /nobreak
|
||
|
)
|
||
|
|
||
|
:: 打开默认浏览器并访问http://localhost:8888/
|
||
|
start "" "http://localhost:8888/"
|
||
|
start "" "http://localhost:8888/packages/amis-editor/#/"
|
||
|
|
||
|
|
||
|
:: 结束脚本
|
||
|
exit
|