本文整理汇总了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(); }
});