本文整理匯總了TypeScript中electron.shell.showItemInFolder方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript shell.showItemInFolder方法的具體用法?TypeScript shell.showItemInFolder怎麽用?TypeScript shell.showItemInFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類electron.shell
的用法示例。
在下文中一共展示了shell.showItemInFolder方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: open
export function open(folder: string) {
if (os.platform() === "darwin") {
// openItem will open the finder but it will appear *under* the app
// which is a bit silly, so we just reveal it instead.
shell.showItemInFolder(folder);
} else {
shell.openItem(folder);
}
}
示例2: openDirectorySafe
Fs.stat(path, (err, stats) => {
if (err) {
log.error(`Unable to find file at '${path}'`, err)
return
}
if (stats.isDirectory()) {
openDirectorySafe(path)
} else {
shell.showItemInFolder(path)
}
})
示例3:
Fs.stat(path, (err, stats) => {
if (err) {
log.error(`Unable to find file at '${path}'`, err)
return
}
if (stats.isDirectory()) {
const fileURL = Url.format({
pathname: path,
protocol: 'file:',
slashes: true,
})
shell.openExternal(fileURL)
} else {
shell.showItemInFolder(path)
}
})
示例4:
(event: Electron.IpcMessageEvent, { path }: { path: string }) => {
shell.showItemInFolder(path)
}
示例5: onOpenProjectsFolderClick
function onOpenProjectsFolderClick() {
electron.shell.showItemInFolder(`${settings.userDataPath}/projects`);
}
示例6: async
watcher.on(actions.openAppLog, async (store, action) => {
const path = mainLogPath();
logger.info(`Opening app log at ${path}`);
shell.showItemInFolder(path);
});
示例7:
socket.on('shell-showItemInFolder', (fullPath) => {
const success = shell.showItemInFolder(fullPath);
socket.emit('shell-showItemInFolderCompleted', success);
});
示例8:
.then(() => {
shell.showItemInFolder(logPath)
})
示例9: showItemInFolder
export function showItemInFolder(path: string) { electron.shell.showItemInFolder(path); }
示例10:
process.nextTick(function () {
shell.showItemInFolder(utils.convertBracketsPathToWindowsPath(getExtensionsFolder()));
if (callback) { callback(); }
});