diff --git a/packages/bruno-electron/src/utils/filesystem.js b/packages/bruno-electron/src/utils/filesystem.js index 0263939ae..8b5b63357 100644 --- a/packages/bruno-electron/src/utils/filesystem.js +++ b/packages/bruno-electron/src/utils/filesystem.js @@ -160,6 +160,10 @@ const sanitizeDirectoryName = (name) => { return name.replace(/[<>:"/\\|?*\x00-\x1F]+/g, '-'); }; +const isWindowsOS = () => { + return os.platform() === 'win32'; +} + const safeToRename = (oldPath, newPath) => { try { // If the new path doesn't exist, it's safe to rename @@ -170,7 +174,7 @@ const safeToRename = (oldPath, newPath) => { const oldStat = fs.statSync(oldPath); const newStat = fs.statSync(newPath); - if (os.platform() === 'win32') { + if (isWindowsOS()) { // Windows-specific comparison: // Check if both files have the same birth time, size (Since, Win FAT-32 doesn't use inodes) @@ -204,5 +208,6 @@ module.exports = { searchForFiles, searchForBruFiles, sanitizeDirectoryName, + isWindowsOS, safeToRename };