react-native-create-library icon indicating copy to clipboard operation
react-native-create-library copied to clipboard

examples_postinstall removes wrong files

Open Phecda opened this issue 5 years ago • 0 comments

Circumstance

  • node 10.5.0
  • npm 6.1.0
  • macOS High Sierra (10.13.5)

Description

In example/node_modules/ my library is actually a symbolic link instead of a real copied directory, therefore the script examples_postinstall(#75 ) removes example itself and my library's node_modules.

Workaround

Adding below codes works for me, but not sure for other situation.

if (fs.lstatSync(libraryNodeModulesPath).isSymbolicLink()) {
      console.log('Symbolic link detected. End deleting');
      return;
}

Phecda avatar Jan 15 '19 15:01 Phecda