From d69f8efaefb0c5b7eb43b8956eda24b020e5f241 Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Tue, 29 Jul 2025 18:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/deploy.js | 5 ++++- pingan/deploy.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/deploy.js b/admin/deploy.js index ccf9bb0..db27469 100644 --- a/admin/deploy.js +++ b/admin/deploy.js @@ -1,6 +1,9 @@ const { execSync } = require('child_process'); const path = require('path'); const fs = require('fs'); +const os = require('os'); + +const isWindows = os.platform() === 'win32'; // 配置目标Git仓库信息 const config = { @@ -9,7 +12,7 @@ const config = { distPath: path.resolve(__dirname, './dist'), // 构建产物目录 // commitMessage: `Auto-deploy at ${new Date().toISOString()}` commitMessage: `Auto-deploy at ${new Date().toLocaleString('sv-SE')}`, // 提交信息 - gitPath: 'E:\\', //仓库本地保存路径 + gitPath: isWindows ? 'E:\\' : '/opt/', //仓库本地保存路径 dirName: 'hcb-admin' //仓库文件夹名 }; diff --git a/pingan/deploy.js b/pingan/deploy.js index 64f975f..5064495 100644 --- a/pingan/deploy.js +++ b/pingan/deploy.js @@ -1,7 +1,9 @@ const { execSync } = require('child_process'); const path = require('path'); const fs = require('fs'); +const os = require('os'); +const isWindows = os.platform() === 'win32'; // 配置目标Git仓库信息 const config = { repoUrl: 'http://git2.haodian.cn/xiaoyu/hcb-pingan.git', // 目标仓库地址 @@ -9,8 +11,8 @@ const config = { distPath: path.resolve(__dirname, './dist'), // 构建产物目录 // commitMessage: `Auto-deploy at ${new Date().toISOString()}` commitMessage: `Auto-deploy at ${new Date().toLocaleString('sv-SE')}`, // 提交信息 - gitPath: 'E:\\', //仓库本地保存路径 - dirName: 'pinan_dist' //仓库文件夹名 + gitPath: isWindows ? 'E:\\' : '/opt/', //仓库本地保存路径 + dirName: 'hcb-pingan' //仓库文件夹名 }; /**