mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-24 08:53:30 +01:00
Bugfix/rename request open tab not found (#3192)
* Refactor: Normalize and resolve paths in renameItem action * Refactor: Normalize and resolve paths in renameItem action (handler side) * :
This commit is contained in:
parent
1f17d39a91
commit
a1719a33fc
@ -16,6 +16,7 @@ const {
|
||||
sanitizeDirectoryName,
|
||||
isWSLPath,
|
||||
normalizeWslPath,
|
||||
normalizeAndResolvePath
|
||||
} = require('../utils/filesystem');
|
||||
const { openCollectionDialog } = require('../app/collections');
|
||||
const { generateUidBasedOnHash, stringifyJson, safeParseJSON, safeStringifyJSON } = require('../utils/common');
|
||||
@ -329,12 +330,8 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
|
||||
ipcMain.handle('renderer:rename-item', async (event, oldPath, newPath, newName) => {
|
||||
try {
|
||||
// Normalize paths if they are WSL paths
|
||||
if (isWSLPath(oldPath)) {
|
||||
oldPath = normalizeWslPath(oldPath);
|
||||
}
|
||||
if (isWSLPath(newPath)) {
|
||||
newPath = normalizeWslPath(newPath);
|
||||
}
|
||||
oldPath = isWSLPath(oldPath) ? normalizeWslPath(oldPath) : normalizeAndResolvePath(oldPath);
|
||||
newPath = isWSLPath(newPath) ? normalizeWslPath(newPath) : normalizeAndResolvePath(newPath);
|
||||
|
||||
if (!fs.existsSync(oldPath)) {
|
||||
throw new Error(`path: ${oldPath} does not exist`);
|
||||
|
Loading…
Reference in New Issue
Block a user