From f8fffb6f0ffdc2d57c79e619af1c740a3f9aad18 Mon Sep 17 00:00:00 2001 From: Minun Date: Thu, 9 Apr 2020 13:50:03 +0800 Subject: [PATCH] fix selection copy --- tools/fix-selection-copy | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 tools/fix-selection-copy diff --git a/tools/fix-selection-copy b/tools/fix-selection-copy new file mode 100755 index 0000000..885eb34 --- /dev/null +++ b/tools/fix-selection-copy @@ -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));