mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-14 22:54:32 +08:00
quickcommand新增六个系统级弹窗接口showSystemMessageBox、showSystemInputBox、showSystemConfirmBox、showSystemSelectList、showSystemButtonBox、showSystemTextArea
This commit is contained in:
21
plugin/lib/getQuickcommandFile.js
Normal file
21
plugin/lib/getQuickcommandFile.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const os = require("os");
|
||||
|
||||
const getQuickcommandTempFile = (ext, name, dir = "quickcommandTempDir") => {
|
||||
if (!name) name = new Date().getTime() + (Math.random() * 10 ** 6).toFixed();
|
||||
let tempDir = path.join(os.tmpdir(), dir);
|
||||
if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir);
|
||||
return path.join(tempDir, `${name}.${ext}`);
|
||||
};
|
||||
|
||||
const getQuickcommandFolderFile = (name, ext) => {
|
||||
const quickcommandPath = path.join(
|
||||
window.utools.getPath("userData"),
|
||||
"quickcommand"
|
||||
);
|
||||
if (!fs.existsSync(quickcommandPath)) fs.mkdirSync(quickcommandPath);
|
||||
return path.join(quickcommandPath, `${name}.${ext}`);
|
||||
};
|
||||
|
||||
module.exports = { getQuickcommandTempFile, getQuickcommandFolderFile };
|
||||
Reference in New Issue
Block a user