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
parent
8dd5ef113b
commit
6ba4e35f51
|
@ -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'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue