Fix chart saving on Linux/Mac

This commit is contained in:
swordcube
2023-06-15 17:22:38 -05:00
committed by GitHub
parent ef000bb0f5
commit f935fa0aec
+6 -5
View File
@@ -176,11 +176,12 @@ class Chart {
var meta = filteredChart.meta;
#if sys
if (!FileSystem.exists('${songFolderPath}\\charts\\'))
FileSystem.createDirectory('${songFolderPath}\\charts\\');
var sep:String = #if windows "\\" #else "/" #end; /** \\ doesn't work correctly on linux!! remember!! windows and linux are different doofy!! **/
if (!FileSystem.exists('${songFolderPath}${sep}charts${sep}'))
FileSystem.createDirectory('${songFolderPath}${sep}charts${sep}');
var chartPath = '${songFolderPath}\\charts\\${difficulty.trim()}.json';
var metaPath = '${songFolderPath}\\meta.json';
var chartPath = '${songFolderPath}${sep}charts${sep}${difficulty.trim()}.json';
var metaPath = '${songFolderPath}${sep}meta.json';
File.saveContent(chartPath, Json.stringify(filteredChart, null, saveSettings.prettyPrint == true ? "\t" : null));
@@ -216,4 +217,4 @@ typedef ChartSaveSettings = {
var ?overrideExistingMeta:Bool;
var ?saveMetaInChart:Bool;
var ?prettyPrint:Bool;
}
}