Clean up code.

This commit is contained in:
zodern
2019-02-13 15:25:26 -06:00
committed by Ben Newman
parent c34a61a3f9
commit aadbbfbd2b
2 changed files with 5 additions and 5 deletions

View File

@@ -231,18 +231,19 @@ Previous builder: ${previousBuilder.outputPath}, this builder: ${outputPath}`
return partsOut.join(files.pathSep);
}
// Checks if a file with the same path and hash was written by
// the previous builder. If it was, it adds it to the cache.
// It also makes sure the parent directories exist and are part of the cache.
//
// the previous builder. If it was, it adds it to the cache and makes
// sure the parent directories exist and are part of the cache.
//
// Returns true if the file was already written
usePreviousWrite (relPath, hash, sanitize) {
relPath = this._normalizeFilePath(relPath, sanitize);
this._ensureDirectory(files.pathDirname(relPath));
const previouslyWritten = this.previousWrittenHashes[relPath] === hash;
if (previouslyWritten) {
this._ensureDirectory(files.pathDirname(relPath));
this.writtenHashes[relPath] = hash;
this.usedAsFile[relPath] = true;
}

View File

@@ -1168,7 +1168,6 @@ class Target {
data: resource.data,
cacheable: false,
hash: resource.hash,
sourcePath: resource.sourcePath,
skipSri: !!resource.hash
};