Open
Conversation
Owner
|
@anarcat Mind making this something that gets logged to gittorrentd stdout, rather than in README? That way people will definitely see it. |
Author
|
Here did another patch. Here is the output: diff --git a/gittorrentd b/gittorrentd
index 2383bfd..38aa23b 100755
--- a/gittorrentd
+++ b/gittorrentd
@@ -79,13 +79,12 @@ dht.on('ready', function () {
var repos = glob.sync('*/.git/git-daemon-export-ok')
var count = repos.length
repos.forEach(function (repo) {
- console.log('in repo ' + repo)
+ console.log('I will publish the repository found @ ./' + repo)
repo = repo.replace(/git-daemon-export-ok$/, '')
- console.log(repo)
var upload = spawn('git-upload-pack', ['--strict', repo])
upload.stdout.on('data', function (line) {
var lines = line.toString().split('\n')
- lines.forEach(function (line) {
+ lines.forEach(function (line) {
var arr = line.toString().split(' ')
if (arr.length === 2) {
var sha = arr[0].toString()
@@ -143,8 +142,14 @@ dht.on('ready', function () {
])}
console.log(json)
dht.put(opts, function (errors, hash) {
- console.error('errors=', errors)
- console.log('hash=', hash.toString('hex'))
+ if(errors.length > 0) {
+ console.error('errors=', errors)
+ }
+ console.log('You and your friends can now do:');
+ for(reponame in userProfile.repositories) {
+ console.log('git clone gittorrent://' + hash.toString('hex') + '/' + reponame);
+ }
+
})
} |
|
For smoother on boarding the README must notify that git-remote-gittorrent must in the path for instance: amirouche@gittorrent > PATH=`pwd`:$PATH git clone gittorrent://0178778c22c5a515413be7ab82dc518beaacc53b/f1n2c1t4t10ns |
Author
|
ping? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #22