Files
eden/tools/cpm/common.sh
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
810 B
Bash
Raw Normal View History

#!/bin/sh -e
2025-12-31 17:16:46 +01:00
# SPDX-FileCopyrightText: Copyright 2025 crueter
# SPDX-License-Identifier: LGPL-3.0-or-later
##################################
# CHANGE THESE FOR YOUR PROJECT! #
##################################
2025-12-31 17:16:46 +01:00
# TODO: cache cpmfile defs
# How many levels to go (3 is 2 subdirs max)
MAXDEPTH=3
2025-10-20 03:43:15 +02:00
# For your project you'll want to change this to define what dirs you have cpmfiles in
# Remember to account for the MAXDEPTH variable!
# Adding ./ before each will help to remove duplicates
2025-12-31 17:16:46 +01:00
CPMFILES=$(find . -maxdepth "$MAXDEPTH" -name cpmfile.json | sort | uniq)
2025-10-20 03:43:15 +02:00
# shellcheck disable=SC2016
2025-12-31 17:16:46 +01:00
PACKAGES=$(echo "$CPMFILES" | xargs jq -s 'reduce .[] as $item ({}; . * $item)')
LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")')
export PACKAGES
2025-10-20 03:43:15 +02:00
export CPMFILES
export LIBS
export DIRS
export MAXDEPTH