mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 06:16:27 +08:00
ban掉utools enter和out
This commit is contained in:
parent
7729108ebe
commit
724e969f07
@ -214,22 +214,22 @@ if (process.platform !== 'linux') quickcommand.runInTerminal = function(cmdline,
|
|||||||
}
|
}
|
||||||
|
|
||||||
let getCommandToLaunchTerminal = (cmdline, dir) => {
|
let getCommandToLaunchTerminal = (cmdline, dir) => {
|
||||||
let cd = ''
|
let cd = ''
|
||||||
if (utools.isWindows()) {
|
if (utools.isWindows()) {
|
||||||
let appPath = path.join(utools.getPath('home'), '/AppData/Local/Microsoft/WindowsApps/')
|
let appPath = path.join(utools.getPath('home'), '/AppData/Local/Microsoft/WindowsApps/')
|
||||||
// 直接 existsSync wt.exe 无效
|
// 直接 existsSync wt.exe 无效
|
||||||
if (fs.existsSync(appPath) && fs.readdirSync(appPath).includes('wt.exe')) {
|
if (fs.existsSync(appPath) && fs.readdirSync(appPath).includes('wt.exe')) {
|
||||||
cmdline = cmdline.replace(/"/g, `\\"`)
|
|
||||||
if (dir) cd = `-d "${dir.replace(/\\/g, '/')}"`
|
|
||||||
command = `${appPath}wt.exe ${cd} cmd /k "${cmdline}"`
|
|
||||||
} else {
|
|
||||||
cmdline = cmdline.replace(/"/g, `^"`)
|
|
||||||
if (dir) cd = `cd /d "${dir.replace(/\\/g, '/')}" &&`
|
|
||||||
command = `${cd} start "" cmd /k "${cmdline}"`
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cmdline = cmdline.replace(/"/g, `\\"`)
|
cmdline = cmdline.replace(/"/g, `\\"`)
|
||||||
if (dir) cd = `cd ${dir.replace(/ /g, `\\\\ `)} &&`
|
if (dir) cd = `-d "${dir.replace(/\\/g, '/')}"`
|
||||||
|
command = `${appPath}wt.exe ${cd} cmd /k "${cmdline}"`
|
||||||
|
} else {
|
||||||
|
cmdline = cmdline.replace(/"/g, `^"`)
|
||||||
|
if (dir) cd = `cd /d "${dir.replace(/\\/g, '/')}" &&`
|
||||||
|
command = `${cd} start "" cmd /k "${cmdline}"`
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cmdline = cmdline.replace(/"/g, `\\"`)
|
||||||
|
if (dir) cd = `cd ${dir.replace(/ /g, `\\\\ `)} &&`
|
||||||
if (fs.existsSync('/Applications/iTerm.app')) {
|
if (fs.existsSync('/Applications/iTerm.app')) {
|
||||||
command = `osascript -e 'tell application "iTerm"
|
command = `osascript -e 'tell application "iTerm"
|
||||||
create window with default profile
|
create window with default profile
|
||||||
@ -394,12 +394,12 @@ window.getSelectFile = hwnd => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.showHelpPage = path => {
|
window.showHelpPage = path => {
|
||||||
utools.ubrowser
|
utools.ubrowser
|
||||||
.goto("https://www.yuque.com/fofolee-awga0/cpbg1m/bg31vl" + path)
|
.goto("https://www.yuque.com/fofolee-awga0/cpbg1m/bg31vl" + path)
|
||||||
.run({
|
.run({
|
||||||
width: 1380,
|
width: 1380,
|
||||||
height: 750
|
height: 750
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.clipboardReadText = () => electron.clipboard.readText()
|
window.clipboardReadText = () => electron.clipboard.readText()
|
||||||
@ -465,6 +465,9 @@ window.getuToolsLite = () => {
|
|||||||
delete utoolsLite.getUserServerTemporaryToken
|
delete utoolsLite.getUserServerTemporaryToken
|
||||||
delete utoolsLite.openPayment
|
delete utoolsLite.openPayment
|
||||||
delete utoolsLite.fetchUserPayments
|
delete utoolsLite.fetchUserPayments
|
||||||
|
// 其他
|
||||||
|
delete utoolsLite.onPluginEnter
|
||||||
|
delete utoolsLite.onPluginOut
|
||||||
Object.freeze(utoolsLite)
|
Object.freeze(utoolsLite)
|
||||||
return utoolsLite
|
return utoolsLite
|
||||||
}
|
}
|
||||||
@ -668,4 +671,4 @@ window.quickcommandHttpServer = () => {
|
|||||||
run,
|
run,
|
||||||
stop
|
stop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,10 +33,10 @@ export default defineComponent({
|
|||||||
window.utools = window.getuToolsLite();
|
window.utools = window.getuToolsLite();
|
||||||
if (!this.checkVer()) return;
|
if (!this.checkVer()) return;
|
||||||
this.startUp();
|
this.startUp();
|
||||||
utools.onPluginEnter((enter) => {
|
this.utools.whole.onPluginEnter((enter) => {
|
||||||
this.enterPlugin(enter);
|
this.enterPlugin(enter);
|
||||||
});
|
});
|
||||||
utools.onPluginOut(() => {
|
this.utools.whole.onPluginOut(() => {
|
||||||
this.outPlugin();
|
this.outPlugin();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user