    # stick a copy in packages' dist/ for tests and local dev
    mkdir -p "$PACKAGE_DIRECTORY/dist"
    cp "$BUILD_PATH/headless-$BUILD_NAME" "$PACKAGE_DIRECTORY/dist/$CHANNEL-headless-$BUILD_NAME"

    # Cleanup
    rm -Rf "$BUILD_PATH"
  else
    echo "$BUILD_NAME version $VERSION was previously package. Skipping."
  fi
}

# main script

if [ ! -z "$1" ]; then