Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Initial commit for repoExists #776

Closed
wants to merge 2 commits into from
Closed

Initial commit for repoExists #776

wants to merge 2 commits into from

Conversation

aphelionz
Copy link
Contributor

I've created an extra utility function based on @dignifiedquire and my conversation in #773

Happy to fix any issues or write up any required documentation here.

Also, we should discuss what we should do with utils.ifRepoExists and utils.repoExists which are very similar but very differently behaving functions.

Copy link
Member

@victorb victorb left a comment

Choose a reason for hiding this comment

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

Sweet! Been needing this a couple of times so I think this is useful addition.

cb(err, exists)
})
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's converge repoExists and ifRepoExists and make the converged function async (with callbacks and a promisify wrapper), the reason why it needs to be async is because the repo might be over a wire (like a S3 bucket).

Copy link
Member

Choose a reason for hiding this comment

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

Hi @aphelionz , how is the development of this feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@diasdavid Gonna push some more commit(s) today.

Copy link
Member

Choose a reason for hiding this comment

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

Let me know if you need any help :)

@daviddias
Copy link
Member

@aphelionz could you also please follow the commit message format? https://github.com/ipfs/community/blob/master/js-project-guidelines.md#commit-message-format (I know this might feel annoying, but it helps us create awesome changelogs! :))

@@ -62,6 +63,7 @@ class IPFS {
this.bitswap = components.bitswap(this)
this.ping = components.ping(this)
this.pubsub = components.pubsub(this)
this.repoExists = utils.repoExists(this)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a new utility function, we could just assign this.repoExists to repoInstance.exists and all should work. Would be less duplicated code + tests.

Copy link
Contributor Author

@aphelionz aphelionz Mar 7, 2017

Choose a reason for hiding this comment

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

I'll give that a shot. The test should still run against this.repoExists though, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I would say we should still test it, to be sure. Better safe than sorry

@daviddias daviddias added the status/ready Ready to be worked label Mar 9, 2017
@daviddias daviddias mentioned this pull request Mar 22, 2017
4 tasks
@daviddias
Copy link
Member

Is there still an interest in this feature?

@aphelionz aphelionz closed this Apr 13, 2017
@Kubuxu Kubuxu removed the status/ready Ready to be worked label Apr 13, 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.

4 participants