broccoli-caching-writer
Advanced tools
Comparing version 0.4.1 to 0.4.2
20
index.js
@@ -174,15 +174,21 @@ var fs = require('fs'); | ||
function testCanLink () { | ||
var canLink = false; | ||
var canLinkSrc = path.join(__dirname, "canLinkSrc.tmp"); | ||
var canLinkDest = path.join(__dirname, "canLinkDest.tmp"); | ||
try { | ||
fs.writeFileSync(canLinkSrc) | ||
fs.writeFileSync(canLinkSrc); | ||
} catch (e) { | ||
return false; | ||
} | ||
try { | ||
fs.linkSync(canLinkSrc, canLinkDest); | ||
canLink = true; | ||
} | ||
finally { | ||
fs.unlinkSync(canLinkDest); | ||
} catch (e) { | ||
fs.unlinkSync(canLinkSrc); | ||
return false; | ||
} | ||
return canLink; | ||
fs.unlinkSync(canLinkDest); | ||
return true; | ||
} |
{ | ||
"name": "broccoli-caching-writer", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Broccoli Caching Writer | ||
[![Build Status](https://travis-ci.org/rjackson/broccoli-caching-writer.svg?branch=master)](https://travis-ci.org/rjackson/broccoli-caching-writer) | ||
[![Build Status](https://travis-ci.org/rwjblue/broccoli-caching-writer.svg?branch=master)](https://travis-ci.org/rwjblue/broccoli-caching-writer) | ||
@@ -5,0 +5,0 @@ Adds a thin caching layer based on the computed hash of the input tree. If the input tree has changed, |
12084
282