fix selection copy

This commit is contained in:
Minun 2020-04-09 13:50:03 +08:00
parent ae7ff76e18
commit f8fffb6f0f

17
tools/fix-selection-copy Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env mew_js
@info("Patching editor selection copy configs");
let configPath = @.fs.homePath(".config/wechat_devtools/Default/Editor/User/settings.json");
let config = undefined;
if (@.fs.exists.file(configPath)) {
config = JSON.parse(@.fs.readFile.sync(configPath, "utf8"));
} else {
config = {};
}
config["editor.selectionClipboard"] = false;
@.fs.makeDirs(@.fs.dirname(configPath));
@.fs.writeFile.sync(configPath, JSON.stringify(config, null, 4));