Fix weirdly platform-dependent folder naming logic (PR #850, fix #708)

This commit is contained in:
Siddharth Srinivasan 2020-01-15 06:09:37 -08:00 committed by Ronan Jouchet
parent 18813776ca
commit 010f88aa1b
2 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,3 @@
import _ from 'lodash';
import sanitizeFilenameLib from 'sanitize-filename';
import { DEFAULT_APP_NAME } from '../constants';
@ -11,7 +10,7 @@ export default function(platform, str) {
// spaces will cause problems with Ubuntu when pinned to the dock
if (platform === 'linux') {
return _.kebabCase(result);
return result.replace(/ /g, '');
}
return result;
}

View File

@ -27,9 +27,9 @@ describe('replacing non ascii characters', () => {
});
describe('when the platform is linux', () => {
test('it should return a kebab cased name', () => {
test('it should return a name without spaces', () => {
const param = 'some name';
const expectedResult = 'some-name';
const expectedResult = 'somename';
const result = sanitizeFilename('linux', param);
expect(result).toBe(expectedResult);
});