1772530674

This commit is contained in:
Docker7530
2026-03-03 17:37:57 +08:00
parent 546b32c344
commit a0d7c1ba97
18 changed files with 725 additions and 355 deletions
@@ -1,21 +1,9 @@
module.exports = async (params) => {
const { app } = params;
// 获取当前仓库路径
const vaultPath = app.vault.adapter.basePath;
// 构建 Windows Terminal 命令
const command = `wt -d "${vaultPath}"`;
// 使用 Node.js child_process 执行命令
const { exec } = require('child_process');
exec(command, (error, stdout, stderr) => {
if (error) {
console.error('执行失败:', error);
new Notice('无法打开终端');
return;
}
console.log('终端已打开');
});
module.exports = async function openTerminal(params) {
const { app } = params;
const vaultPath = app.vault.adapter.basePath;
const command = `wt -d "${vaultPath}"`;
const { exec } = require("node:child_process");
exec(command, (error) => {
if (error) console.error("执行失败:", error);
});
};