File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22# Build @processmaker/* packages in dependency order, cascading downstream.
3- # Reads processmaker.downstream from each package.json (source of truth).
3+ # Reads processmaker.downstream and processmaker.command from each package.json (source of truth).
44set -euo pipefail
55
66STACK_DIR=" ${STACK_DIR:- js-stack} "
@@ -57,21 +57,21 @@ resolve_ref() {
5757}
5858
5959get_downstream () {
60- jq -r ' (.processmaker.downstream // .processmaker.build.downstream // [])[]?'
60+ if ! jq -e ' .processmaker | has("downstream")' > /dev/null; then
61+ echo " ::error::processmaker.downstream is required in package.json" >&2
62+ exit 1
63+ fi
64+ jq -r ' .processmaker.downstream[]?'
6165}
6266
6367get_build_command () {
6468 local cmd
65- cmd=$( jq -r ' .processmaker.build.command // empty' )
66- if [[ -n " $cmd " && " $cmd " != " null" ]]; then
67- echo " $cmd "
68- return
69- fi
70- if jq -e ' .scripts["build-bundle"]' > /dev/null; then
71- echo " build-bundle"
72- elif jq -e ' .scripts["build"]' > /dev/null; then
73- echo " build"
69+ cmd=$( jq -r ' .processmaker.command // empty' )
70+ if [[ -z " $cmd " || " $cmd " == " null" ]]; then
71+ echo " ::error::processmaker.command is required in package.json" >&2
72+ exit 1
7473 fi
74+ echo " $cmd "
7575}
7676
7777get_pm_deps () {
@@ -216,12 +216,10 @@ build_package() {
216216 local build_cmd
217217 build_cmd=$( get_build_command)
218218
219- if [[ -n " $build_cmd " ]]; then
220- if uses_yarn; then
221- yarn run " $build_cmd "
222- else
223- npm run " $build_cmd "
224- fi
219+ if uses_yarn; then
220+ yarn run " $build_cmd "
221+ else
222+ npm run " $build_cmd "
225223 fi
226224
227225 local pkg_name tarball dest
You can’t perform that action at this time.
0 commit comments