Cache libvips binaries to reduce re-install time #1301

This commit is contained in:
Lovell Fuller
2018-08-05 10:31:41 +01:00
parent bfdd27eeef
commit 532de4ecab
4 changed files with 67 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
const assert = require('assert');
const fs = require('fs');
const semver = require('semver');
const libvips = require('../../lib/libvips');
@@ -66,5 +67,11 @@ describe('libvips binaries', function () {
delete process.env.SHARP_IGNORE_GLOBAL_LIBVIPS;
});
it('cachePath returns a valid path ending with _libvips', function () {
const cachePath = libvips.cachePath();
assert.strictEqual('string', typeof cachePath);
assert.strictEqual('_libvips', cachePath.substr(-8));
assert.strictEqual(true, fs.existsSync(cachePath));
});
});
});