mirror of
https://github.com/SrIzan10/full-calendar-ics-converter.git
synced 2026-06-06 00:47:04 +00:00
fix: directory special characters not removed
This commit is contained in:
3
index.ts
3
index.ts
@@ -5,6 +5,7 @@ import { parseArgs } from 'util'
|
||||
import { argsSchema } from "./utils/types/schema";
|
||||
import removeLastSlash from "./utils/removeLastSlash";
|
||||
import getAverage from './utils/getAverage';
|
||||
import removeDirSpecialCharacters from './utils/removeDirSpecialCharacters';
|
||||
|
||||
const { values } = parseArgs({
|
||||
args: Bun.argv,
|
||||
@@ -48,7 +49,7 @@ for (const event of events) {
|
||||
|
||||
const initialWritePerf = performance.now()
|
||||
|
||||
await Bun.write(`${removeLastSlash(parsedValues.data.out)}/${event.fileName}`, event.frontmatterContent)
|
||||
await Bun.write(`${removeLastSlash(parsedValues.data.out)}/${removeDirSpecialCharacters(event.fileName)}`, event.frontmatterContent)
|
||||
|
||||
const finalWritePerf = performance.now()
|
||||
writePerfArray.push(finalWritePerf - initialWritePerf)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"dependencies": {
|
||||
"ical.js": "^2.0.1",
|
||||
"luxon": "^3.4.4",
|
||||
"node-ical": "^0.18.0",
|
||||
"rrule": "^2.8.1",
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
|
||||
3
utils/removeDirSpecialCharacters.ts
Normal file
3
utils/removeDirSpecialCharacters.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function removeDirSpecialCharacters(dir: string): string {
|
||||
return dir.replace(/[\\/:*?"<>|º]/g, '');
|
||||
}
|
||||
Reference in New Issue
Block a user