grafana-wizzy / wizzy

Manage & automate Grafana with easy wizzy
https://grafana-wizzy.com
Apache License 2.0
468 stars 60 forks source link

Forward slash in folder name breaks export #169

Open sciurus opened 4 years ago

sciurus commented 4 years ago

In Grafana, I created a folder name Test / Folder. Inside that folder I created a dashboard named A Test Dashboard.

The dashboard fails to export with the error

✘ Dashboard a-test-dashboard import failed: Error: ENOENT: no such file or directory, mkdir 'dashboards/Test / Folder'

I tried creating a dashboard with name Test / Dashboard in the General folder and it was successfully exported as test-dashboard.

It looks like https://github.com/grafana-wizzy/wizzy/blob/840b23b38e3933f3cad55898bdb1338ba55a14e1/src/util/localfs.js#L86 is used to sanitize the names of files but not of directories.

Sytten commented 4 years ago

Good catch, I will sanitize the folder name thanks for reporting. I plan to start working on wizzy next week. Please comment back if its not fixed soon.