File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed
Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,30 @@ endfunction
307307
308308call s: add_methods (' app' , [' facades' , ' routes' , ' templates' ])
309309
310- function ! s: app_makeprg () abort dict
311- return ' php artisan'
310+ " "
311+ " Get artisan command line, optionally including [args].
312+ "
313+ " echo laravel#app().makeprg()
314+ " => 'php artisan'
315+ "
316+ " echo laravel#app().makeprg('route:list')
317+ " => 'php artisan route:list'
318+ "
319+ " Arguments may be passed as individual function parameters or as a list.
320+ "
321+ " echo laravel#app().makeprg(['route:list', '-vvv'])
322+ " echo laravel#app().makeprg('route:list', '-vvv')
323+ " => 'php artisan route:list -vvv'
324+ function ! s: app_makeprg (... ) abort dict
325+ if a: 0 == 1 && type (a: 1 ) == type ([])
326+ let args = a: 1
327+ elseif a: 0 > 1
328+ let args = copy (a: 000 )
329+ else
330+ let args = []
331+ endif
332+
333+ return join ([' php' , ' artisan' ] + args )
312334endfunction
313335
314336call s: add_methods (' app' , [' makeprg' ])
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ endfunction
4040function ! s: artisan_exec (args ) abort
4141 try
4242 let cwd = s: cd (laravel#app ().path ())
43- let result = systemlist (join ([ laravel#app ().makeprg ()] + a: args ))
43+ let result = systemlist (laravel#app ().makeprg (a: args ))
4444 finally
4545 call s: cd (cwd)
4646 endtry
@@ -76,10 +76,10 @@ function! laravel#artisan#exec(...) abort
7676 " if exists(':terminal')
7777 " tabedit %
7878 " execute 'lcd' fnameescape(laravel#app().path())
79- " execute 'terminal' laravel#app().makeprg() join( args)
79+ " execute 'terminal' laravel#app().makeprg(args)
8080 " else
8181 let cwd = s: cd (laravel#app ().path ())
82- execute ' !' . laravel#app ().makeprg () join ( args )
82+ execute ' !' . laravel#app ().makeprg (args )
8383 call s: cd (cwd)
8484 " endif
8585
You can’t perform that action at this time.
0 commit comments