mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-19 00:02:50 +08:00
16 lines
618 B
C#
16 lines
618 B
C#
var path = Directory.GetFiles(@".idea", "workspace.xml", SearchOption.AllDirectories).First();
|
|
const string findStr = """
|
|
"keyToString": {
|
|
""";
|
|
const string replaceStr = """
|
|
"keyToString": {
|
|
"rider.code.cleanup.on.save": "true",
|
|
""";
|
|
var content = File.ReadAllText(path);
|
|
if(content.Contains("rider.code.cleanup.on.save")){
|
|
Console.WriteLine("alreay added");
|
|
return;
|
|
}
|
|
content = content.Replace(findStr, replaceStr);
|
|
Console.WriteLine(content);
|
|
File.WriteAllText(path, content); |