mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-28 20:29:04 +00:00
parent
18813776ca
commit
010f88aa1b
@ -1,4 +1,3 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import sanitizeFilenameLib from 'sanitize-filename';
|
import sanitizeFilenameLib from 'sanitize-filename';
|
||||||
import { DEFAULT_APP_NAME } from '../constants';
|
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
|
// spaces will cause problems with Ubuntu when pinned to the dock
|
||||||
if (platform === 'linux') {
|
if (platform === 'linux') {
|
||||||
return _.kebabCase(result);
|
return result.replace(/ /g, '');
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@ describe('replacing non ascii characters', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('when the platform is linux', () => {
|
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 param = 'some name';
|
||||||
const expectedResult = 'some-name';
|
const expectedResult = 'somename';
|
||||||
const result = sanitizeFilename('linux', param);
|
const result = sanitizeFilename('linux', param);
|
||||||
expect(result).toBe(expectedResult);
|
expect(result).toBe(expectedResult);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user