Files
eden/tools/cpm/package/add.sh
T

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

55 lines
851 B
Bash
Raw Normal View History

2025-12-31 17:16:46 +01:00
#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2026 crueter
2025-12-31 17:16:46 +01:00
# SPDX-License-Identifier: LGPL-3.0-or-later
RETURN=0
usage() {
cat <<EOF
2026-06-26 02:22:04 +02:00
Usage: cpmutil.sh package add [package name]
2025-12-31 17:16:46 +01:00
Add a new package to a cpmfile.
Note that you are still responsible for integrating this into your CMake.
EOF
2026-06-26 02:22:04 +02:00
exit "$RETURN"
2025-12-31 17:16:46 +01:00
}
die() {
echo "-- $*" >&2
2026-06-26 02:22:04 +02:00
RETURN=1 usage
2025-12-31 17:16:46 +01:00
}
while :; do
case "$1" in
-[a-z]*)
opt=$(printf '%s' "$1" | sed 's/^-//')
while [ -n "$opt" ]; do
# cut out first char from the optstring
char=$(echo "$opt" | cut -c1)
opt=$(echo "$opt" | cut -c2-)
case "$char" in
h) usage ;;
*) die "Invalid option -$char" ;;
esac
done
;;
--help) usage ;;
"$0") break ;;
"") break ;;
*) PKG="$1" ;;
esac
shift
done
[ -n "$PKG" ] || die "You must specify a package name."
2025-12-31 17:16:46 +01:00
export PKG
"$SCRIPTS"/util/interactive.sh