check-is-in-git-install.sh 477 B

123456789
  1. #!/usr/bin/env bash
  2. # Check if you happen to call prepare for a repository that's already in node_modules.
  3. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] ||
  4. # The name of the containing directory that 'npm` uses, which looks like
  5. # $HOME/.npm/_cacache/git-cloneXXXXXX
  6. [ "$(basename "$(dirname "$PWD")")" = 'tmp' ] ||
  7. # The name of the containing directory that 'yarn` uses, which looks like
  8. # $(yarn cache dir)/.tmp/XXXXX
  9. [ "$(basename "$(dirname "$PWD")")" = '.tmp' ]