Répare "yarn prepare" échouant si présence d'un espace dans le chemin d'un fichier

Signed-off-by: Dimitri Bourreau <contact@dimitribourreau.me>
pull/2024/head
Dimitri Bourreau 2022-02-19 11:24:42 +01:00 committed by Johan Girod
parent 8dd5ef113b
commit 6ba4e35f51
2 changed files with 6 additions and 3 deletions

View File

@ -4,13 +4,15 @@ import fs from 'fs'
import path from 'path'
import { filter, flatten, map, partition, pipe } from 'ramda'
import { compose } from 'redux'
import { fileURLToPath } from 'url';
import { createDataDir, writeInDataDir } from './utils.js'
const matomoSiteVisitsHistory = JSON.parse(
fs.readFileSync(
path.join(
import.meta.url.replace('file:', ''),
'../matomoVisitHistory.json'
fileURLToPath(import.meta.url),
'..',
'matomoVisitHistory.json'
)
)
)

View File

@ -1,7 +1,8 @@
import { existsSync, mkdirSync, writeFileSync } from 'fs'
import { join } from 'path'
import { fileURLToPath } from 'url'
const dataDir = new URL('../source/data/', import.meta.url).pathname
const dataDir = join(fileURLToPath(import.meta.url), '..', '..', 'source', 'data')
export function createDataDir() {
if (!existsSync(dataDir)) {