Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Updated bz.#25

Open
hemanth wants to merge 1 commit intoMozillaIndia:masterfrom
hemanth:refactor
Open

Updated bz.#25
hemanth wants to merge 1 commit intoMozillaIndia:masterfrom
hemanth:refactor

Conversation

@hemanth
Copy link
Copy Markdown
Contributor

@hemanth hemanth commented Aug 23, 2014

Fixes #21

/cc @debloper @MrDHat

If possible please do provide the API, so I can test it once.

@MrDHat
Copy link
Copy Markdown
Contributor

MrDHat commented Aug 23, 2014

@hemanth emailed you the api key. Thank you for the patch 😄

@hemanth
Copy link
Copy Markdown
Contributor Author

hemanth commented Aug 23, 2014

@MrDHat Kool!

@debloper
Copy link
Copy Markdown
Member

Thanks for the patch @hemanth

+@sankha93 to verify if it's safe to remove the BZ hack (whether the methods have been added upstream, or is a part of bz-api itself), also the necessity of ./bz explicitly over bz.

@hemanth
Copy link
Copy Markdown
Contributor Author

hemanth commented Aug 23, 2014

@debloper Strangely the latest bzapi gives a 404 but this works and on installing the latest bz and doing a require('bz') would result in:

bzClient.countBugs({
             ^
TypeError: Object #<Object> has no method 'countBugs'
    at createUser (/home/ubuntu/leaderchalk/index.js:63:14)
    at /home/ubuntu/leaderchalk/index.js:37:44
    at fs.js:271:14
    at Object.oncomplete (fs.js:107:15)

But the bz API states countBugs

@debloper
Copy link
Copy Markdown
Member

Yes, that's exactly why:

// copy our copy of bz.js
var execResult = execSync.exec('cp bz.js node_modules/bz/');
if (execResult.code != 0) {
  // Command failed
  console.log(execResult.stderr);
  process.exit(1);
}

part was necessary.

@hemanth
Copy link
Copy Markdown
Contributor Author

hemanth commented Aug 23, 2014

@debloper I don't get the point of copying it to node_modules when we can require it with a ./ ...
But here we are trying to use the published module, rather than the local bz.js.

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.

Upgrade to the Bugzilla REST API

3 participants