Comparing version 0.0.8 to 0.0.9
22
4chan.js
@@ -186,3 +186,9 @@ var optimist = require('optimist'); | ||
fs.readdirSync(d).forEach(function(f) { | ||
fs.renameSync(d + '/' + f, f); | ||
var t = f, m; | ||
// undo the splitPics renaming if present | ||
if(m = /^\d+-(\d+\..+)$/.exec(t)) | ||
t = m[1]; | ||
fs.renameSync(d + '/' + f, t); | ||
}); | ||
@@ -207,2 +213,9 @@ | ||
var cur = /\/([^\/]+)$/.exec(process.cwd())[1]; | ||
var file = 1, pfx2 = ''; | ||
var digits2 = Math.floor(log10(arr.length)) + 1; | ||
while(digits2--) | ||
pfx2 += '0'; | ||
var time = Math.floor(Date.now() / 1000) - arr.length; | ||
@@ -218,3 +231,8 @@ while((cut = arr.splice(0, num)).length) { | ||
cut.forEach(function(v) { | ||
fs.renameSync(v, s + '/' + v); | ||
var q = String(file++); | ||
q = pfx2.slice(q.length) + q; | ||
fs.utimesSync(v, time, time++); | ||
fs.renameSync(v, s + '/' + q + '-' + v); | ||
}); | ||
@@ -221,0 +239,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"keywords": [ "4chan", "picture", "downloader", "utility", "command line" ], | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"homepage": "http://github.com/ypocat/4chan", | ||
@@ -9,0 +9,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18597
398