if (process.env.CI) process.exit(0);

var rimraf = require('rimraf');
var extend = require('util')._extend;
var gyp = require('node-pre-gyp');

rimraf.sync('./build');

var versions = ['0.10.0', '0.12.0', '4.0.0', '5.0.0'];
var matrix = {
  x64: ['win32', 'linux', 'darwin'],
  ia32: ['win32']
};

var targets = [];
Object.keys(matrix).forEach(function(arch) {
  matrix[arch].forEach(function(platform) {
    versions.forEach(function(version) {
      targets.push({
        target: version,
        target_platform: platform,
        target_arch: arch
      });
    });
  });
}, []);

iterate();

function iterate(err) {
  if (err) {
    console.log(err.message);
    return process.exit(1);
  }

  var target = targets.pop();

  if (!target) process.exit(0);

  var prog = extend(new gyp.Run(), {opts: target});

  prog.commands.install([], iterate);
}

@@ -1,22 +1,98 @@
-if (process.env.CI
+var npm_argv = JSON.parse(process.env.npm_config_argv);%0Aif (npm_argv.original%5B0%5D !== 'publish'
 ) pr

Fix prepublish script