Comparing version 11.5.3 to 11.5.4
@@ -10,3 +10,3 @@ #!/usr/bin/env node | ||
alias: {p: 'port', q: 'quiet', v: 'version'}, | ||
boolean: ['snapshot', 'exit', 'list', 'quiet', 'version', 'utp', 'temp', 'webrtc', 'ignore-hidden'], | ||
boolean: ['watchFiles', 'snapshot', 'exit', 'list', 'quiet', 'version', 'utp', 'temp', 'webrtc', 'ignore-hidden'], | ||
string: ['signalhub'], | ||
@@ -16,3 +16,4 @@ default: { | ||
'ignore-hidden': true, | ||
utp: true | ||
utp: true, | ||
watchFiles: false | ||
} | ||
@@ -19,0 +20,0 @@ }) |
@@ -8,2 +8,7 @@ # Change Log | ||
## 11.5.4 - 2016-10-28 | ||
### Changed | ||
* Turn off `--watchFiles` by default | ||
* Simplify progress UI | ||
## 11.5.3 - 2016-10-28 | ||
@@ -10,0 +15,0 @@ ### Fixed |
@@ -11,4 +11,3 @@ var chalk = require('chalk') | ||
var addText = 'Adding ' | ||
var updated = false | ||
var initFileCount = 0 | ||
var finalized = false | ||
@@ -63,4 +62,4 @@ dat.stats.rateUp = speedometer() | ||
dat.once('archive-finalized', function () { | ||
addText = 'Added ' | ||
initFileCount = dat.stats.filesTotal | ||
addText = 'Sharing ' | ||
finalized = true | ||
updateStats() | ||
@@ -70,4 +69,2 @@ }) | ||
dat.on('archive-updated', function () { | ||
addText = 'Updating ' | ||
updated = true | ||
updateStats() | ||
@@ -86,13 +83,8 @@ }) | ||
var bytesTotal = stats.bytesTotal | ||
var bytesProgress = stats.bytesProgress | ||
if (dat.live && updated) { | ||
if (stats.filesTotal === stats.filesProgress) addText = 'Updated ' | ||
files = files - initFileCount | ||
bytesTotal = stats.bytesTotal | ||
} | ||
var msg = ui.progress(bytesProgress / bytesTotal) | ||
msg += ' ' + addText + chalk.bold(files) + ' items' | ||
msg += chalk.dim(' (' + prettyBytes(bytesProgress) + '/' + prettyBytes(bytesTotal) + ')') | ||
var msg = ui.progress(stats.bytesProgress / bytesTotal) | ||
msg += ' ' + addText | ||
if (finalized) msg += chalk.bold(files) + ' ' | ||
msg += 'items' | ||
msg += chalk.dim(' (' + prettyBytes(bytesTotal) + ')') | ||
log.status(msg + '\n', 0) | ||
@@ -99,0 +91,0 @@ } |
@@ -30,3 +30,3 @@ var chalk = require('chalk') | ||
if (dat.stats.rateUp && dat.stats.rateUp()) msg += 'Uploading ' + prettyBytes(dat.stats.rateUp()) + '/s. ' | ||
if (dat.archive && dat.archive && dat.archive.live && dat.archive.owner) msg += 'Watching for updates...' | ||
if (dat.options.watchFiles && dat.archive && dat.archive.live && dat.archive.owner) msg += 'Watching for updates...' | ||
return msg | ||
@@ -33,0 +33,0 @@ } |
{ | ||
"name": "dat", | ||
"version": "11.5.3", | ||
"version": "11.5.4", | ||
"description": "Share datasets on the Internet", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -84,15 +84,16 @@ # Dat | ||
share directory and create a dat-link | ||
Share the given directory and create a link which then can be used to | ||
download the data. The process will stay open and watch for filesystem changes. | ||
--watchFiles watch files for changes (beta: still in development) | ||
--snapshot create a snapshot of directory | ||
--port, -p set a specific inbound tcp port | ||
dat <dat-link> <directory> | ||
dat <link> <directory> | ||
download a dat-link into directory | ||
Download a dat-link into directory. Continues to listen for changes and | ||
download them as they are added by the remote peer. | ||
--exit exit process after download finishes | ||
--port, -p set a specific inbound tcp port | ||
general options | ||
General options | ||
@@ -106,2 +107,3 @@ --version, -v get installed dat version | ||
--ignore-hidden ignore hidden files (true by default) | ||
--port, -p set a specific inbound tcp port | ||
``` | ||
@@ -108,0 +110,0 @@ |
@@ -18,3 +18,3 @@ var fs = require('fs') | ||
// cmd: dat <link> downloadDir | ||
var st = spawn(t, dat + ' 5hz25io80t0m1ttr332awpslmlfn1mc5bf1z8lvhh34a9r1ob3 ' + downloadDir) | ||
var st = spawn(t, dat + ' 5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + downloadDir) | ||
st.stdout.match(function (output) { | ||
@@ -32,3 +32,3 @@ var downloading = output.indexOf('Waiting for connections') > -1 | ||
// cmd: dat dat://<link> downloadDir | ||
var st = spawn(t, dat + ' dat://ki0dg8b5ukc7oy5gcdhx4nr27ayncu4gdart3y1zf1b8p9sk48 ' + downloadDir) | ||
var st = spawn(t, dat + ' dat://5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + downloadDir) | ||
st.stdout.match(function (output) { | ||
@@ -45,3 +45,3 @@ var downloading = output.indexOf('Waiting for connections') > -1 | ||
test('accepts https://dat.land links', function (t) { | ||
var st = spawn(t, dat + ' https://dat.land/ki0dg8b5ukc7oy5gcdhx4nr27ayncu4gdart3y1zf1b8p9sk48 ' + downloadDir) | ||
var st = spawn(t, dat + ' https://dat.land/5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + downloadDir) | ||
st.stdout.match(function (output) { | ||
@@ -58,3 +58,3 @@ var downloading = output.indexOf('Waiting for connections') > -1 | ||
test('accepts dat.land links', function (t) { | ||
var st = spawn(t, dat + ' dat.land/ki0dg8b5ukc7oy5gcdhx4nr27ayncu4gdart3y1zf1b8p9sk48 ' + downloadDir) | ||
var st = spawn(t, dat + ' dat.land/5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + downloadDir) | ||
st.stdout.match(function (output) { | ||
@@ -85,3 +85,3 @@ var downloading = output.indexOf('Waiting for connections') > -1 | ||
rimraf.sync(path.join(downloadDir)) | ||
var st = spawn(t, dat + ' 5hz25io80t0m1ttr332awpslmlfn1mc5bf1z8lvhh34a9r1ob3 ' + downloadDir) | ||
var st = spawn(t, dat + ' 5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + downloadDir) | ||
st.stdout.match(function (output) { | ||
@@ -100,3 +100,3 @@ var downloading = output.indexOf('Waiting for connections') > -1 | ||
rimraf.sync(path.join(process.cwd(), '.dat')) // in case we have a .dat folder here | ||
var st = spawn(t, dat + ' 5hz25io80t0m1ttr332awpslmlfn1mc5bf1z8lvhh34a9r1ob3') | ||
var st = spawn(t, dat + ' 5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f') | ||
st.stderr.match(function (output) { | ||
@@ -181,3 +181,3 @@ var gotError = output.indexOf('dat <directory>') > -1 | ||
// cmd: dat <link> . | ||
var downloaderTwo = spawn(t, dat + ' 5hz25io80t0m1ttr332awpslmlfn1mc5bf1z8lvhh34a9r1ob3 ' + tmpdir, {end: false}) | ||
var downloaderTwo = spawn(t, dat + ' 5f6f2ff876519b3f999e21f18f4dc5eb91570cebbcda7725009bdfbe9fdd310f ' + tmpdir, {end: false}) | ||
downloaderTwo.stderr.match(function (output) { | ||
@@ -184,0 +184,0 @@ var contains = output.indexOf('Another Dat was already downloaded here') > -1 |
@@ -103,5 +103,5 @@ var fs = require('fs') | ||
// cmd: dat tests/fixtures | ||
var st = spawn(t, dat + ' ' + fixtures) | ||
var st = spawn(t, dat + ' ' + fixtures + ' --watchFiles') | ||
st.stdout.match(function (output) { | ||
var finished = output.match('Added') | ||
var finished = output.match('items') | ||
if (!finished) return false | ||
@@ -123,3 +123,3 @@ | ||
st.stdout.match(function (output) { | ||
var finished = output.match('Added') | ||
var finished = output.match('items') | ||
if (!finished) return false | ||
@@ -126,0 +126,0 @@ |
@@ -6,2 +6,3 @@ dat <directory> | ||
--watchFiles watch files for changes (beta: still in development) | ||
--snapshot create a snapshot of directory | ||
@@ -8,0 +9,0 @@ |
163043
356
881