1772530674
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user