From 485b2f48bc47a4a513d927c33211cc4cf00c2287 Mon Sep 17 00:00:00 2001 From: Mateo Gallardo Date: Tue, 13 Feb 2024 19:08:57 -0300 Subject: [PATCH] Fixed relative paths for file params in Windows (#1564) --- packages/bruno-app/src/components/FilePickerEditor/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/FilePickerEditor/index.js b/packages/bruno-app/src/components/FilePickerEditor/index.js index 90e4a79e3..a7b67264d 100644 --- a/packages/bruno-app/src/components/FilePickerEditor/index.js +++ b/packages/bruno-app/src/components/FilePickerEditor/index.js @@ -4,6 +4,7 @@ import { useDispatch } from 'react-redux'; import { browseFiles } from 'providers/ReduxStore/slices/collections/actions'; import { IconX } from '@tabler/icons'; import { isWindowsOS } from 'utils/common/platform'; +import slash from 'utils/common/slash'; const FilePickerEditor = ({ value, onChange, collection }) => { value = value || []; @@ -27,7 +28,7 @@ const FilePickerEditor = ({ value, onChange, collection }) => { const collectionDir = collection.pathname; if (filePath.startsWith(collectionDir)) { - return path.relative(collectionDir, filePath); + return path.relative(slash(collectionDir), slash(filePath)); } return filePath;