Only accept recipe name in shell scripts

Rather than recipe path.
This commit is contained in:
bjorn3 2025-09-02 20:43:39 +02:00
parent bf026ddaf8
commit 87699a364e
3 changed files with 8 additions and 27 deletions

View File

@ -5,20 +5,14 @@ source config.sh
if [ $# = 0 ]
then
recipes="$(target/release/list_recipes)"
recipes="$(target/release/list_recipes --short)"
else
recipes="$@"
fi
for recipe in $recipes
for recipe_name in $recipes
do
if (echo "$recipe" | grep '.*/.*' >/dev/null); then
recipe_name=$(basename "$recipe")
recipe_path="$recipe"
else
recipe_name="$recipe"
recipe_path=`target/release/find_recipe $recipe`
fi
recipe_path=`target/release/find_recipe $recipe_name`
echo -e "\033[01;38;5;215mcook - clean $recipe_name\033[0m"
rm -rf "${ROOT}/$recipe_path/target/${TARGET}"

View File

@ -22,15 +22,7 @@ then
recipes="$(target/release/list_recipes)"
fi
for recipe_path in $recipes
for recipe_name in $recipes
do
if (echo "$recipe_path" | grep '.*/.*' >/dev/null); then
recipe_name=$(basename "$recipe_path")
recipe_path="$recipe_path"
else
recipe_name="$recipe_path"
recipe_path=`target/release/find_recipe $recipe_name`
fi
target/release/cook --fetch-only "$recipe_name"
done

View File

@ -5,21 +5,16 @@ source config.sh
if [ $# = 0 ]
then
recipes="$(target/release/list_recipes)"
recipes="$(target/release/list_recipes --short)"
else
recipes="$@"
fi
for recipe in $recipes
for recipe_name in $recipes
do
if (echo "$recipe" | grep '.*/.*' >/dev/null); then
recipe_name=$(basename "$recipe")
recipe_path="$recipe"
else
recipe_name="$recipe"
recipe_path=`target/release/find_recipe $recipe`
fi
recipe_path=`target/release/find_recipe $recipe_name`
echo -e "\033[01;38;5;215mcook - unfetch $recipe_name\033[0m"
rm -rfv "$recipe_path"/source "$recipe_path"/source.tar
done