Permalink
Browse files
backwards compatible links
- Loading branch information...
Showing
with
4 additions
and
2 deletions.
-
+1
−1
bin/cli.js
-
+3
−1
lib/dat.js
|
|
@@ -46,7 +46,7 @@ function getCommand () { |
|
|
|
|
|
function isDatLink (val, quiet) {
|
|
|
// TODO: switch to using dat-encoding here
|
|
|
var isLink = (val.length === 50)
|
|
|
var isLink = (val.length === 50 || val.length === 64)
|
|
|
if (quiet || isLink) return isLink
|
|
|
onerror('Invalid Dat Link')
|
|
|
}
|
|
|
|
|
|
@@ -23,7 +23,9 @@ function Dat (opts) { |
|
|
|
|
|
this.dir = opts.dir === '.' ? process.cwd() : opts.dir
|
|
|
this.datPath = opts.datPath || path.join(self.dir, '.dat')
|
|
|
this.key = opts.key ? encoding.decode(opts.key) : null
|
|
|
if (opts.key && opts.key.length === 50) opts.key = encoding.decode(opts.key)
|
|
|
else if (opts.key && opts.key.length === 64) opts.key = Buffer(opts.key, 'hex')
|
|
|
this.key = opts.key
|
|
|
this.snapshot = opts.snapshot
|
|
|
this.ignore = ignore
|
|
|
this.swarm = null
|
|
|
|
0 comments on commit
a32cc3a