@tricoteuses/senat 2.15.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,9 +203,7 @@ export function parseCommissionCRFromFile(htmlFilePath, best, fallback) {
203
203
  const allDayPoints = buildPointsFromParagraphs($, dayParas);
204
204
  const points = allDayPoints.length > 0 ? allDayPoints : [];
205
205
  // --- session ---
206
- const session = dateISO.slice(5, 7) >= "10"
207
- ? `${dateISO.slice(0, 4)}-${Number(dateISO.slice(0, 4)) + 1}`
208
- : `${Number(dateISO.slice(0, 4)) - 1}-${dateISO.slice(0, 4)}`;
206
+ const session = dateISO.slice(5, 7) >= "10" ? `${dateISO.slice(0, 4)}` : `${Number(dateISO.slice(0, 4)) - 1}`;
209
207
  const contenu = {
210
208
  quantiemes: { journee: dateISO, session },
211
209
  point: points,
@@ -232,8 +232,6 @@ async function retrieveCommissionCRs(options = {}) {
232
232
  ensureAndClearDir(transformedRoot);
233
233
  for (const session of sessions) {
234
234
  const originalSessionDir = path.join(originalRoot, String(session));
235
- const transformedSessionDir = path.join(transformedRoot, String(session));
236
- fs.ensureDirSync(transformedSessionDir);
237
235
  if (!(await fs.pathExists(originalSessionDir)))
238
236
  continue;
239
237
  const commissionDirs = (await fs.readdir(originalSessionDir, { withFileTypes: true }))
@@ -303,6 +301,8 @@ async function retrieveCommissionCRs(options = {}) {
303
301
  continue;
304
302
  }
305
303
  const fileUid = cr.uid;
304
+ const transformedSessionDir = path.join(transformedRoot, String(daySession));
305
+ fs.ensureDirSync(transformedSessionDir);
306
306
  const outPath = path.join(transformedSessionDir, `${fileUid}.json`);
307
307
  await fs.writeJSON(outPath, cr, { spaces: 2 });
308
308
  const npts = Array.isArray(cr.contenu.point) ? cr.contenu.point.length : cr.contenu.point ? 1 : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",