mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
persist request/folder uids after request/folder resequencing and ui updates (#4611)
* move file/folder uids to new paths * drag file/folder preview ui updates, can item be dropped ui hint check --------- Co-authored-by: lohit <lohit@usebruno.com>
This commit is contained in:
@@ -324,6 +324,25 @@ const removePath = async (source) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively gets paths.
|
||||
const getPaths = async (source) => {
|
||||
let paths = [];
|
||||
const _getPaths = async (source) => {
|
||||
const stat = await fsPromises.lstat(source);
|
||||
paths.push(source);
|
||||
if (stat.isDirectory()) {
|
||||
const entries = await fsPromises.readdir(source);
|
||||
for (const entry of entries) {
|
||||
const entryPath = path.join(source, entry);
|
||||
await _getPaths(entryPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
await _getPaths(source);
|
||||
return paths;
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
isValidPathname,
|
||||
exists,
|
||||
@@ -352,5 +371,6 @@ module.exports = {
|
||||
safeWriteFile,
|
||||
safeWriteFileSync,
|
||||
copyPath,
|
||||
removePath
|
||||
removePath,
|
||||
getPaths
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user