Created
May 3, 2017 23:37
-
-
Save capnmidnight/06e27ee4b5100d22546443e5a473d60a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = PathX.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "AndTheory", "Dodgewall", "scores.js"); | |
var parts = path.Split(Path.DirectorySeparatorChar); | |
var rebuild = parts[0]; | |
for(int i = 1; i < parts.Length - 1; ++i) | |
{ | |
rebuild = PathX.Combine(rebuild, parts[i]); | |
if(!Directory.Exists(rebuild)) | |
{ | |
Directory.CreateDirectory(rebuild); | |
} | |
} | |
File.WriteAllText(path, JsonUtility.ToJson(scoreObject)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment