From f935fa0aecd5130b01bc639800474e4f160e9160 Mon Sep 17 00:00:00 2001 From: swordcube <49110074+swordcube@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:22:38 -0500 Subject: [PATCH] Fix chart saving on Linux/Mac --- source/funkin/backend/chart/Chart.hx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/funkin/backend/chart/Chart.hx b/source/funkin/backend/chart/Chart.hx index fe20fd95..70ee87c7 100644 --- a/source/funkin/backend/chart/Chart.hx +++ b/source/funkin/backend/chart/Chart.hx @@ -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; -} \ No newline at end of file +}