35 lines
505 B
Bash
35 lines
505 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
# shellcheck source=./bin/_commands/_extract.sh
|
||
|
. ./_commands/_extract.sh
|
||
|
|
||
|
dir=$1 file=$2
|
||
|
|
||
|
echo "Default actions for $dir/$file"
|
||
|
|
||
|
create() {
|
||
|
values=$(extract "$dir" "$file" ac_create)
|
||
|
|
||
|
for value in $values
|
||
|
do
|
||
|
echo "Creating $value"
|
||
|
cp "../content/$value.md" "$dir/$value.md"
|
||
|
done
|
||
|
}
|
||
|
|
||
|
delete() {
|
||
|
values=$(extract "$dir" "$file" ac_delete)
|
||
|
|
||
|
for value in $values
|
||
|
do
|
||
|
echo "Deleting $value"
|
||
|
rm -f "$dir/$value.md"
|
||
|
done
|
||
|
}
|
||
|
|
||
|
if [ -z "${dir##*/content/users/*}" ]
|
||
|
then
|
||
|
create
|
||
|
delete
|
||
|
fi
|