Merge branch 'release/21.56.0' into master
[gitter.git] / preinstall.sh
blob3df080da3fd039e405b25ab0fa2903ac2ecad705
1 #!/usr/bin/env bash
3 set -euo pipefail
4 IFS=$'\n\t'
6 find_file_deps() {
7 node -e '''
8 var pkg = require("./package.json");
9 var path = require("path");
10 function dep(d) {
11 return Object.keys(d).filter(function(key) {
12 var spec = d[key];
13 return spec.indexOf("file:") === 0
14 });
16 var fileDeps = dep(pkg.dependencies).concat(dep(pkg.devDependencies));
17 fileDeps.forEach(function(f) {
18 console.log(path.resolve(path.join("node_modules", f)));
20 '''
23 find_deps() {
24 linklocal list --format '%S' --no-summary || find_file_deps;
27 find_deps|while read line; do
28 if [[ -d "${line}" ]] && [[ ! -h "${line}" ]]; then
29 rm -r "${line}";
30 fi;
31 done