景好勇win11 4 months ago
parent
commit
59606b7933
2 changed files with 8 additions and 14 deletions
  1. 8 0
      script/ansible/bin/mybdeploy.ps1
  2. 0 14
      script/ansible/bin/mydeploy.ps1

+ 8 - 0
script/ansible/bin/mybdeploy.ps1

@@ -0,0 +1,8 @@
+# 切换到脚本目录
+
+# 使用 scp 命令复制,排除 vendor 和 doc 目录
+$sourceDir = "D:\work\xiaoding\owl-admin"
+$targetDir = "root@192.168.110.85:/www/wwwroot/xiaoding"
+
+# 执行 scp 命令,使用正确的语法并排除 vendor 和 doc 目录
+scp -r $(Get-ChildItem $sourceDir -Exclude "vendor","doc","storage","docs" | Select-Object -ExpandProperty FullName) $targetDir

+ 0 - 14
script/ansible/bin/mydeploy.ps1

@@ -1,14 +0,0 @@
-# 切换到脚本目录
-
-# 获取脚本所在目录的绝对路径
-$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
-
-# 切换到项目根目录
-Set-Location (Split-Path -Parent (Split-Path -Parent $scriptPath))
-
-# 使用 scp 命令复制,排除 vendor 目录
-$sourceDir = "D:\work\xiaoding\owl-admin"
-$targetDir = "root@192.168.110.85:/www/wwwroot/xiaoding"
-
-# 执行 scp 命令,使用正确的语法
-scp -r $sourceDir/* $targetDir