From 07f16f72cf63e443c25e3d07c19659c7daf917dc Mon Sep 17 00:00:00 2001 From: "142vip.cn" Date: Sun, 29 Oct 2023 00:34:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(scripts):=20=E4=BC=98=E5=8C=96deploy?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/deploy b/scripts/deploy index 7e8d0024..096547d3 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -5,7 +5,7 @@ * - ./scripts/deploy ali * - ./scripts/deploy github */ -const { execShell } = require('./.exec') +const {execShell} = require('./.exec') const packageVersion = require('../package.json').version const dockerDeployInfo = { @@ -31,8 +31,8 @@ const SupportScripts = { cd - `, Ali: [ - // 容器存在即删除 - ` + // 容器存在即删除 + ` if docker inspect --format='{{.State.Running}}' ${dockerDeployInfo.containerName} >/dev/null 2>&1;then docker rm -f ${dockerDeployInfo.containerName} exit 0; @@ -41,9 +41,9 @@ const SupportScripts = { exit 1; fi `, - // 镜像存在即删除 - ` - if [[ "$(docker images -q ${imageName} 2> /dev/null)" != "" ]];then + // 镜像存在即删除 + ` + if [ "$(docker images -q ${imageName} 2> /dev/null)" != "" ];then docker rmi ${imageName} exit 0; else @@ -51,8 +51,8 @@ const SupportScripts = { exit 1; fi `, - // 运行容器 - ` + // 运行容器 + ` docker run -d --name ${dockerDeployInfo.containerName} \ -p 7000:80 \ --network=${dockerDeployInfo.networkName} \ @@ -82,7 +82,7 @@ function getDeployCommand() { // 执行 -;(async() => { +;(async () => { const deployCommand = getDeployCommand() // console.log(deployCommand) await execShell(deployCommand)