/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v7.4.0
tools/scripts/build.sh
28 строк
978 B
James Henry
chore: deps updates (#3715)
07 июн 2023, 23:38
Не верифицирован
07 июн 2023, 23:38
5095b04
Код
Авторство
О чём код?
#!/usr/bin/env bash # For now we do not do anything within the build process other than make a copy of the source # and put it in a root dist/ directory # pwd should be the root of the workspace if [ ! -f ./lerna.json ]; then echo "Error: This script must be run from the root of the workspace" exit 1 fi workspaceRoot=$(pwd) # Teardown any old outputs rm -rf ./dist # Build any packages which require a build step npx nx run-many -t build # Resolve the packages using lerna itself IFS=$'\n' read -d '' -a packageLocations < <((node -e 'const fs = require("fs"); const pkgs = JSON.parse(fs.readFileSync(0, "utf-8")); for (const p of pkgs) { console.log(p.location); }') <<<"$(npx lerna list --json)") for packageLocation in "${packageLocations[@]}"; do newLocation=$(echo "./dist/${packageLocation#${workspaceRoot}/}/") mkdir -p $newLocation cp -R $packageLocation/. $newLocation/. done echo "Successfully copied all ${#packageLocations[@]} packages to ./dist"