mirror of
https://github.com/bestnite/quadlet-migrator-skill.git
synced 2026-04-26 19:21:53 +00:00
Add helper script templates and align reference guidance.
Point helper-script generation at shared templates, tighten prefix-based Quadlet handling, and refresh the bundled Quadlet reference formatting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Stop the reviewed lifecycle unit(s), then remove installed Quadlet unit files.
|
||||
# Update the variables and systemctl_cmd() function below before using this template.
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
QUADLET_PREFIX='app-'
|
||||
QUADLET_TARGET_DIR="${HOME}/.config/containers/systemd"
|
||||
LIFECYCLE_UNITS='app-pod.service'
|
||||
|
||||
systemctl_cmd() {
|
||||
systemctl --user "$@"
|
||||
}
|
||||
|
||||
list_quadlet_files() {
|
||||
for ext in container pod network volume build image kube; do
|
||||
for file in "$SCRIPT_DIR"/"$QUADLET_PREFIX"*."$ext"; do
|
||||
[ -e "$file" ] || continue
|
||||
printf '%s\n' "$file"
|
||||
done
|
||||
done | LC_ALL=C sort -u
|
||||
}
|
||||
|
||||
files=$(list_quadlet_files)
|
||||
[ -n "$files" ] || {
|
||||
printf 'No Quadlet files found for prefix %s\n' "$QUADLET_PREFIX" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
for unit in $LIFECYCLE_UNITS; do
|
||||
systemctl_cmd stop "$unit" || true
|
||||
done
|
||||
|
||||
printf '%s\n' "$files" | while IFS= read -r file; do
|
||||
rm -f -- "$QUADLET_TARGET_DIR/$(basename -- "$file")"
|
||||
done
|
||||
Reference in New Issue
Block a user