Mercurial > vim-piecrust
comparison plugin/piecrust.vim @ 3:af8514b79c04 default tip
Fix for PieCrust 1.0-rc1.
Added very simple `Pcprepare` command.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 14 Mar 2013 22:15:58 -0700 |
parents | 6185e60279c0 |
children |
comparison
equal
deleted
inserted
replaced
2:0595eed8abef | 3:af8514b79c04 |
---|---|
111 " argument list. | 111 " argument list. |
112 let l:arg_list = a:000 | 112 let l:arg_list = a:000 |
113 if a:0 == 1 && type(a:1) == type([]) | 113 if a:0 == 1 && type(a:1) == type([]) |
114 let l:arg_list = a:1 | 114 let l:arg_list = a:1 |
115 endif | 115 endif |
116 let l:chef_command = g:piecrust_chef_executable . ' ' . a:command | 116 let l:chef_command = g:piecrust_chef_executable . ' --root=' . shellescape(s:stripslash(self.root_dir)) |
117 let l:chef_command = l:chef_command . ' --root=' . shellescape(s:stripslash(self.root_dir)) | 117 let l:chef_command = l:chef_command . ' ' . a:command . ' ' . join(l:arg_list, ' ') |
118 let l:chef_command = l:chef_command . ' ' . join(l:arg_list, ' ') | |
119 call s:trace("Running Chef command: " . l:chef_command) | 118 call s:trace("Running Chef command: " . l:chef_command) |
120 return system(l:chef_command) | 119 return system(l:chef_command) |
121 endfunction | 120 endfunction |
122 | 121 |
123 " Website cache map | 122 " Website cache map |
219 call map(l:matches, 's:normalizepath(v:val)') | 218 call map(l:matches, 's:normalizepath(v:val)') |
220 return l:matches | 219 return l:matches |
221 endfunction | 220 endfunction |
222 | 221 |
223 call s:AddMainCommand("-bang -nargs=? -complete=customlist,s:FindWebsiteFiles Pcedit :call s:PcEdit(<bang>0, <f-args>)") | 222 call s:AddMainCommand("-bang -nargs=? -complete=customlist,s:FindWebsiteFiles Pcedit :call s:PcEdit(<bang>0, <f-args>)") |
223 | |
224 " }}} | |
225 | |
226 " Pcprepare {{{ | |
227 | |
228 function! s:PcPrepare(type, slug) abort | |
229 let l:website = s:piecrust_website() | |
230 let l:output = l:website.RunCommand('prepare', type, slug) | |
231 call s:trace(l:output) | |
232 endfunction | |
233 | |
234 call s:AddMainCommand("-nargs=* Pcprepare :call s:PcPrepare(<f-args>)") | |
224 | 235 |
225 " }}} | 236 " }}} |
226 | 237 |
227 " Pcposturl {{{ | 238 " Pcposturl {{{ |
228 | 239 |