Compare commits

..

No commits in common. "db6c5f5079e7d85f8282ee619aff5b0c57c67d74" and "d70e660a79d565cae43f54dcab33847058f97cf1" have entirely different histories.

3 changed files with 9 additions and 8 deletions

View File

@ -98,7 +98,7 @@ function walkDir(parent, sub, opts) {
// TODO stream sha1 (for assets)
return fs
.readFile(path.join(root, stat.name), null)
.readFileAsync(path.join(root, stat.name), null)
.then(function (buffer) {
var contents = buffer.toString("utf8");
file.sha1 = sha1sum(contents);
@ -144,7 +144,7 @@ function getfs(blogdir, filepaths) {
return forEachAsync(filepaths, function (filepath) {
var pathname = safeResolve(blogdir, filepath);
return fs
.lstat(pathname)
.lstatAsync(pathname)
.then(function (stat) {
return fs.readFile(pathname, null).then(function (buffer) {
files.push({
@ -304,9 +304,13 @@ function putfs(blogdir, files, options) {
return forEachAsync(files, function (file) {
// TODO use lastModifiedDate as per client request?
// TODO compare sha1 sums for integrity
// NOTE existsAsync is backwards
return fs
.access(file.realPath)
.existsAsync(file.realPath)
.then(function () {
return fs.writeFile(file.realPath, file.contents, "utf8");
})
.catch(function (/*exists*/) {
if (file.delete || !file.contents) {
return fs.unlink(file.realPath);
}
@ -317,9 +321,6 @@ function putfs(blogdir, files, options) {
return fs.writeFile(file.realPath, file.contents, "utf8");
})
.catch(function () {
return fs.writeFile(file.realPath, file.contents, "utf8");
})
.catch(function (e) {
putfsResults.errors.push({
type: "file",

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "desirae",
"version": "0.12.3",
"version": "0.12.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "desirae",
"version": "0.12.3",
"version": "0.12.2",
"description": "An in-browser static blog library and static site generator. Similar to Jekyll, Octopress, Nanoc, etc",
"main": "desirae.js",
"scripts": {