mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
✨ feat: 插件适配Windows
1. 适配windows 2. 应群友的建议提供小写r一样可以呼出帮助
This commit is contained in:
parent
791e8b827c
commit
dc1aa0769c
@ -16,17 +16,13 @@ export class help extends plugin {
|
||||
priority: 500,
|
||||
rule: [
|
||||
{
|
||||
reg: '^#*R(插件)?(命令|帮助|菜单|help|说明|功能|指令|使用说明)$',
|
||||
reg: '^#*(R|r)(插件)?(命令|帮助|菜单|help|说明|功能|指令|使用说明)$',
|
||||
fnc: 'help'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* rule - 闲心插件帮助
|
||||
* @returns
|
||||
*/
|
||||
async help () {
|
||||
let data = await Help.get(this.e)
|
||||
if (!data) return
|
||||
|
@ -136,11 +136,20 @@ function mergeAcFileToMp4(tsNames, FullFileName, outputFileName, shouldDelete =
|
||||
fs.writeFileSync(ffmpegList, concatStrs.join("\n"));
|
||||
const outPath = path.resolve(outputFileName);
|
||||
|
||||
// 执行命令
|
||||
let cmd = 'ffmpeg';
|
||||
const env = {
|
||||
...process.env,
|
||||
PATH: '/usr/local/bin:' + child_process.execSync('echo $PATH').toString(),
|
||||
};
|
||||
// 判断当前环境
|
||||
let env;
|
||||
if (process.platform === "win32") {
|
||||
env = process.env
|
||||
} else if (process.platform === "linux") {
|
||||
env = {
|
||||
...process.env,
|
||||
PATH: '/usr/local/bin:' + child_process.execSync('echo $PATH').toString(),
|
||||
};
|
||||
} else {
|
||||
console.log("暂时不支持当前操作系统!")
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
child_process.exec(
|
||||
|
@ -63,10 +63,19 @@ function getDownloadUrl (url) {
|
||||
|
||||
function mergeFileToMp4 (vFullFileName, aFullFileName, outputFileName, shouldDelete = true) {
|
||||
let cmd = 'ffmpeg';
|
||||
const env = {
|
||||
...process.env,
|
||||
PATH: '/usr/local/bin:' + child_process.execSync('echo $PATH').toString(),
|
||||
};
|
||||
|
||||
// 判断当前环境
|
||||
let env;
|
||||
if (process.platform === "win32") {
|
||||
env = process.env
|
||||
} else if (process.platform === "linux") {
|
||||
env = {
|
||||
...process.env,
|
||||
PATH: '/usr/local/bin:' + child_process.execSync('echo $PATH').toString(),
|
||||
};
|
||||
} else {
|
||||
console.log("暂时不支持当前操作系统!")
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
child_process.exec(
|
||||
|
Loading…
x
Reference in New Issue
Block a user