File tree Expand file tree Collapse file tree 10 files changed +9
-20
lines changed
Expand file tree Collapse file tree 10 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,6 @@ require("salesforce").setup({
131131 org_manager = {
132132 default_org_indicator = " " ,
133133 },
134- -- Default SF CLI executable (should not need to be changed)
135- sf_executable = " sf" ,
136134})
137135```
138136
Original file line number Diff line number Diff line change @@ -47,8 +47,6 @@ You can pass in a lua table of options to customize the plugin. The default opti
4747 org_manager = {
4848 default_org_indicator = "",
4949 },
50- -- Default SF CLI executable (should not need to be changed)
51- sf_executable = "sf",
5250}
5351<
5452
Original file line number Diff line number Diff line change @@ -24,14 +24,8 @@ function Config:new()
2424 org_manager = {
2525 default_org_indicator = " " ,
2626 },
27- -- Default SF CLI executable (should not need to be changed)
28- sf_executable = " sf" ,
2927 }
3028
31- if jit .os == " Windows" then
32- o .options .sf_executable = " sf.cmd"
33- end
34-
3529 return o
3630end
3731
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ local Util = require("salesforce.util")
22local Job = require (" plenary.job" )
33local Debug = require (" salesforce.debug" )
44local OrgManager = require (" salesforce.org_manager" )
5- local Config = require (" salesforce.config" )
65
76function Job :is_running ()
87 if self .handle and not vim .loop .is_closing (self .handle ) and vim .loop .is_active (self .handle ) then
1514local M = {}
1615
1716local temp_dir
18- local executable = Config : get_options (). sf_executable
17+ local executable = Util . get_sf_executable ()
1918
2019local function diff_callback (j )
2120 vim .schedule (function ()
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ local Debug = require("salesforce.debug")
33local OrgManager = require (" salesforce.org_manager" )
44local Job = require (" plenary.job" )
55local Util = require (" salesforce.util" )
6- local Config = require (" salesforce.config" )
76
87function Job :is_running ()
98 if self .handle and not vim .loop .is_closing (self .handle ) and vim .loop .is_active (self .handle ) then
@@ -47,7 +46,7 @@ M.execute_anon = function()
4746
4847 Popup :create_popup ({})
4948 Popup :write_to_popup (" Executing anonymous Apex script..." )
50- local executable = Config : get_options (). sf_executable
49+ local executable = Util . get_sf_executable ()
5150 local args = {}
5251 local writer = nil
5352 if not is_unsaved_buffer then
Original file line number Diff line number Diff line change 1414
1515local M = {}
1616
17- local executable = Config : get_options (). sf_executable
17+ local executable = Util . get_sf_executable ()
1818local active_file_path = nil
1919
2020local function push_to_org_callback (j )
Original file line number Diff line number Diff line change 4343--- org_manager = {
4444--- default_org_indicator = "",
4545--- },
46- --- -- Default SF CLI executable (should not need to be changed)
47- --- sf_executable = "sf",
4846--- }
4947--- <
5048local Config = require (" salesforce.config" )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function Job:is_running()
1414end
1515
1616local OrgManager = {}
17- local executable = Config : get_options (). sf_executable
17+ local executable = Util . get_sf_executable ()
1818
1919function OrgManager :new ()
2020 local o = {}
Original file line number Diff line number Diff line change @@ -4,9 +4,8 @@ local OrgManager = require("salesforce.org_manager")
44local Debug = require (" salesforce.debug" )
55local Treesitter = require (" salesforce.treesitter" )
66local Util = require (" salesforce.util" )
7- local Config = require (" salesforce.config" )
87
9- local executable = Config : get_options (). sf_executable
8+ local executable = Util . get_sf_executable ()
109local run_class_command = executable .. ' apex run test -n "%s" --synchronous -r human -o %s'
1110local run_method_command = executable .. ' apex run test -t "%s.%s" --synchronous -r human -o %s'
1211
Original file line number Diff line number Diff line change @@ -158,4 +158,8 @@ function M.clear_error_diagnostics()
158158 vim .diagnostic .reset (namespace , bufnr )
159159end
160160
161+ function M .get_sf_executable ()
162+ return vim .fn .fnamemodify (vim .fn .exepath (" sf" ), " :t" )
163+ end
164+
161165return M
You can’t perform that action at this time.
0 commit comments