CloudCannon / cloudcannon-config-migrator

Migrate your existing cms configuration into CloudCannon config
MIT License
6 stars 0 forks source link

Migration Detection does not work on windows #2

Closed felicienfrancois closed 1 year ago

felicienfrancois commented 1 year ago

Error is :

TypeError: Cannot read properties of null (reading 'id')
    at Object.run (file:///C:/Users/Felicien/AppData/Local/npm-cache/_npx/4a74263e962fa509/node_modules/cloudcannon-config-migrator/src/runner.js:42:57)
    at file:///C:/Users/Felicien/AppData/Local/npm-cache/_npx/4a74263e962fa509/node_modules/cloudcannon-config-migrator/src/index.js:46:8
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

After digging into the code and adding logs, this happens on windows due to path separator \\ instead of / DiskMigrationClient.getAllFiles return something like

[
  '.forestry\\front_matter\\templates\\page.yml',
  '.forestry\\front_matter\\templates\\template.yml',
  '.forestry\\settings.yml',
  ...
]

And forestry migrator check if this list contains .forestry/settings.yml ...

georgephillips commented 1 year ago

Thanks for the issue report. I can see quite a few places that need the slash fix. I will find a windows laptop today and get it all fixed up.

georgephillips commented 1 year ago

@felicienfrancois I have just released version 0.0.8 which adds support for windows. Let me know how it goes