Skip to content

Commit

Permalink
Define "tempfile" from an existent "dict" key and force content download
Browse files Browse the repository at this point in the history
  • Loading branch information
boechat107 committed Aug 11, 2020
1 parent 2778d3f commit 158ad39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/storage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ function! storage#read(cmd, path, dict) abort
if (!has_key(a:dict, a:path))
let tempfile = tempname() . '.' . storage#current_file_extension()
let a:dict[a:path] = tempfile
else
let tempfile = a:dict[a:path]
endif
call storage#get_cmd(a:cmd, a:path, tempfile)
silent execute 'edit' fnameescape(tempfile)
Expand Down Expand Up @@ -101,7 +103,7 @@ function! storage#cmd_script(...) abort
endfunction

function! storage#get_cmd(cmd, bucket, file) abort
let script = storage#cmd_script(a:cmd, 'get', a:bucket, a:file)
let script = storage#cmd_script(a:cmd, 'get --force', a:bucket, a:file)
return storage#run_cmd(script)
endfunction

Expand Down

0 comments on commit 158ad39

Please sign in to comment.