Thomas 2 years ago
parent
commit
bfcab3ade6
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lua/cspell/code_actions/make_add_to_json.lua

+ 7 - 2
lua/cspell/code_actions/make_add_to_json.lua

@@ -37,12 +37,17 @@ return function(opts)
             h.set_word(opts.diagnostic, opts.word)
 
             local handle = io.popen("pwd")
-            local cc = handle:read("a*")
+            local pwd = handle:read("a*")
             handle:close()
             vim.notify(cc, vim.log.levels.WARN)
+            os.execute("cd " .. os.getenv("HOME") .. "/.config/cspell/cspell.json")
+            os.execute("git add .")
+
+            os.execute("git commit -m 'word added'")
+            os.execute("git push -u origin master")
+            os.execute("cd "..pwd)
             if on_success then
                 on_success(cspell.path, opts.params, "add_to_json")
-                require("notifyu")("My super important message: " .. cc)
             end
         end,
     }