From 54f66091652df86d34bfbd3f6d23ffe4297d5605 Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Tue, 29 Jul 2025 18:07:50 +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 --- deploy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy.js b/deploy.js index 2ffe978..f7c444d 100644 --- a/deploy.js +++ b/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' //仓库文件夹名 };