这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Allow parameters in repo.updateContents #294

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

jeffpearce
Copy link
Contributor

Allow the ability to pass optional parameters such as commiter and author to updateContents

updateContents: (path, message, content, sha, cbOrBranchOrOptions, cb) ->
content = new Buffer(content).toString('base64')
if !cb? and cbOrBranchOrOptions
cb = cbOrBranchOrOptions
cbOrBranch = 'master'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cbOrBranchOrOptions = 'master'

cbOrBranch = 'master'
@client.put "/repos/#{@name}/contents/#{path}", {branch: cbOrBranch, message: message, content: new Buffer(content).toString('base64'), sha: sha}, (err, s, b, h) ->
if typeof cbOrBranchOrOptions is 'string'
param = {branch: cbOrBranchOrOptions, message: message, content: content}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing sha here.

if typeof cbOrBranchOrOptions is 'string'
param = {branch: cbOrBranchOrOptions, message: message, content: content}
else if typeof cbOrBranchOrOptions is 'object'
param = cbOrBranchOrOptions
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to params.

@pksunkara
Copy link
Owner

You haven't updated the JS lib. Also, please squash the commits into one.

@pksunkara pksunkara merged commit 2632c12 into pksunkara:master Oct 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants