/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/scripts/build.sh
31 строка
1 KB
“JamesHenry”
fix(list): explicitly exit upon completion
05 фев 2024, 19:38
05 фев 2024, 19:38
bafe090
Код
Авторство
О чём код?
#!/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 # Rerun install step to ensure lerna dist is linked appropriately npm install # 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"