Pushconcept
Jump to navigation
Jump to search
#!/bin/bash
# WF 2020-11-04
# copy a concept from one ProfiWiki to another
pushConcept() {
local l_source="$1"
local l_target="$2"
local l_concept="$3"
echo "pushing concept $l_concept from $l_source to $l_target"
wikipush -l -s $l_source -t $l_target -f -wi -p Concept:$l_concept Template:$l_concept Form:$l_concept Help:$l_concept Category:$l_concept
wikipush -l -s $l_source -t $l_target -f -i -q "{{#ask: [[Property topic::Concept:$l_concept]]|?#=page}}" -qf page
wikipush -l -s $l_source -t $l_target -f -i -q "{{#ask: [[Topic name::$l_concept]]|?Topic context=context}}" -qf context
}
source="master"
target="test"
# commandline option
while [ "$1" != "" ]
do
option=$1
shift
# optionally show usage
case $option in
-s)
source=$1
shift
;;
-t)
target=$1
shift
;;
*)
pushConcept $source $target $option
shift
;;
esac
done