Skip to content

Instantly share code, notes, and snippets.

@jrichardlai
Created January 22, 2016 23:32
Show Gist options
  • Save jrichardlai/a6a36352e1b98eb2946a to your computer and use it in GitHub Desktop.
Save jrichardlai/a6a36352e1b98eb2946a to your computer and use it in GitHub Desktop.
#!/bin/bash -x
find . -name 'fbjs' -print | grep "\./node_modules/fbjs" -v | xargs rm -rf
@alhafoudh
Copy link

oneliner version:

find ./node_modules -type d -name fbjs -and -not -path ./node_modules/fbjs -print -exec rm -rf "{}" \;

@lrettig
Copy link

lrettig commented Jan 29, 2016

@alhafoudh your version works but produces an error at the same time:

> bash postinstall.sh

find: ./node_modules/fbemitter/node_modules/fbjs: No such file or directory
find: ./node_modules/flux/node_modules/fbjs: No such file or directory
find: ./node_modules/react/node_modules/fbjs: No such file or directory
find: ./node_modules/react-native/node_modules/fbjs: No such file or directory

npm ERR! Darwin 15.3.0
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `bash postinstall.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'bash postinstall.sh'.
npm ERR! There is likely additional logging output above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment