Browse Source

git uuuuh

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

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

@@ -37,17 +37,17 @@ return function(opts)
             local pwd = handle:read("a*")
             handle:close()
             local cspell_dir = os.getenv("HOME") .. "/.config/cspell/"
-            vim.notify("dir" .. cspell_dir, vim.log.levels.INFO)
+            vim.notify("dir " .. cspell_dir, vim.log.levels.INFO)
 
-            local cc = os.execute("cd " .. cspell_dir)
-            vim.notify("Created a new cspell.json file at " .. cc, vim.log.levels.INFO)
-            local cc = os.execute("git add .")
+            -- local cc = os.execute("cd " .. cspell_dir)
+            -- vim.notify("Created a new cspell.json file at " .. cc, vim.log.levels.INFO)
+            local cc = os.execute("git -C " .. cspell_dir .. " add .")
             vim.notify("add" .. cc, vim.log.levels.INFO)
-            local cc = os.execute("git commit -m 'word added'")
+            local cc = os.execute("git -C " .. cspell_dir .. " commit -m 'word added'")
             vim.notify("comm" .. cc, vim.log.levels.INFO)
-            local cc = os.execute("git push")
+            local cc = os.execute("git -C " .. cspell_dir .. " push")
             vim.notify("push " .. cc, vim.log.levels.INFO)
-            os.execute("cd " .. pwd)
+            -- os.execute("cd " .. pwd)
 
             -- replace word in buffer to trigger cspell to update diagnostics
             h.set_word(opts.diagnostic, opts.word)