finish fixing folder names when lots of slashes exist; closes #2377

This commit is contained in:
Dane Everitt 2020-09-25 20:44:40 -07:00
parent fe849789a2
commit 4f21fa85f8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -24,7 +24,7 @@ const schema = object().shape({
const generateDirectoryData = (name: string): FileObject => ({ const generateDirectoryData = (name: string): FileObject => ({
key: `dir_${name.split('/', 1)[0] ?? name}`, key: `dir_${name.split('/', 1)[0] ?? name}`,
name: name.split('/', 1)[0] ?? name, name: name.replace(/^(\/*)/, '').split('/', 1)[0] ?? name,
mode: '0644', mode: '0644',
size: 0, size: 0,
isFile: false, isFile: false,