mirror of
https://github.com/danog/gift.git
synced 2024-11-26 20:04:47 +01:00
Use arguments.length to support prior calls to ls_files (#83)
This commit is contained in:
parent
951ba4c0b2
commit
fbc63ff214
@ -293,9 +293,11 @@ module.exports = class Repo
|
||||
# callback - Receives `(err,stdout)`.
|
||||
#
|
||||
ls_files: (files, options, callback) ->
|
||||
[options, callback] = [callback, options] if !callback
|
||||
[files, callback] = [callback, files] if !callback
|
||||
[files, options] = [options, files] if typeof files is 'object' and not _.isArray files
|
||||
# support the old (options, callback) sig
|
||||
if arguments.length < 3
|
||||
[options, callback] = [files, options]
|
||||
files = null
|
||||
callback ?= ->
|
||||
options ?= {}
|
||||
files ?= ''
|
||||
files = [files] if _.isString files
|
||||
|
Loading…
Reference in New Issue
Block a user