git-swap.sh 403 B

12345678910111213
  1. #!/usr/bin/env bash
  2. set -exuo pipefail
  3. # the package is published to NPM from ./dist
  4. # we want the final file structure for git installs to match the npm installs, so we
  5. # delete everything except ./dist and ./node_modules
  6. find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' +
  7. # move everything from ./dist to .
  8. mv dist/* .
  9. # delete the now-empty ./dist
  10. rmdir dist