Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/gifsicle/lib/index.js b/node_modules/gifsicle/lib/index.js
new file mode 100644
index 0000000..92cd87b
--- /dev/null
+++ b/node_modules/gifsicle/lib/index.js
@@ -0,0 +1,17 @@
+'use strict';
+const path = require('path');
+const BinWrapper = require('bin-wrapper');
+const pkg = require('../package.json');
+
+const url = `https://raw.githubusercontent.com/imagemin/gifsicle-bin/v${pkg.version}/vendor/`;
+
+module.exports = new BinWrapper()
+ .src(`${url}macos/gifsicle`, 'darwin')
+ .src(`${url}linux/x86/gifsicle`, 'linux', 'x86')
+ .src(`${url}linux/x64/gifsicle`, 'linux', 'x64')
+ .src(`${url}freebsd/x86/gifsicle`, 'freebsd', 'x86')
+ .src(`${url}freebsd/x64/gifsicle`, 'freebsd', 'x64')
+ .src(`${url}win/x86/gifsicle.exe`, 'win32', 'x86')
+ .src(`${url}win/x64/gifsicle.exe`, 'win32', 'x64')
+ .dest(path.join(__dirname, '../vendor'))
+ .use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle');
diff --git a/node_modules/gifsicle/lib/install.js b/node_modules/gifsicle/lib/install.js
new file mode 100644
index 0000000..76ff8ce
--- /dev/null
+++ b/node_modules/gifsicle/lib/install.js
@@ -0,0 +1,31 @@
+'use strict';
+const path = require('path');
+const binBuild = require('bin-build');
+const log = require('logalot');
+const bin = require('.');
+
+bin.run(['--version']).then(() => {
+ log.success('gifsicle pre-build test passed successfully');
+}).catch(error => {
+ log.warn(error.message);
+ log.warn('gifsicle pre-build test failed');
+ log.info('compiling from source');
+
+ const cfg = [
+ './configure --disable-gifview --disable-gifdiff',
+ `--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
+ ].join(' ');
+
+ binBuild.file(path.resolve(__dirname, '../vendor/source/gifsicle.tar.gz'), [
+ 'autoreconf -ivf',
+ cfg,
+ 'make install'
+ ]).then(() => {
+ log.success('gifsicle built successfully');
+ }).catch(error => {
+ log.error(error.stack);
+
+ // eslint-disable-next-line unicorn/no-process-exit
+ process.exit(1);
+ });
+});