You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
#!/bin/bash
|
|
|
|
### DO NOT EDIT THIS FILE
|
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/includes/bash_header"
|
|
|
|
function usage {
|
|
echo
|
|
echoMainTitle "Installs a plugin"
|
|
echo
|
|
echoSubTitle "Usage:"
|
|
echo
|
|
echo "install-plugin [shortname] [plugin]"
|
|
echo
|
|
echo "--help Prints this message"
|
|
echo " "
|
|
}
|
|
|
|
shortname=$(getArgument "$1" "$(usage)" true)
|
|
plugin=$(getArgument "$2" "$(usage)" true)
|
|
customer=$(getCustomerFromShortname "$shortname")
|
|
project=$(getProjectFromShortname "$shortname")
|
|
project_dir="$project_manager_dir/data/$customer/$project"
|
|
plugin_dir="$project_manager_dir/plugins/$plugin"
|
|
|
|
echo
|
|
echoMainTitle "Install plugin"
|
|
|
|
if [ ! -d "$project_dir/etc/plugins/$plugin" ]
|
|
then
|
|
mkdir "$project_dir/etc/plugins/$plugin"
|
|
fi
|
|
|
|
etc_files=$(list "$plugin/etc")
|
|
for etc_file in "${etc_files[@]}"
|
|
do
|
|
cp "$etc_file" "$project_dir/etc/plugins/$plugin/."
|
|
done
|
|
|
|
postScript "$project_manager_dir/bin/postscripts/commands/install-plugin"
|
|
postScript "$project_dir/bin/postscripts/commands/install-plugin"
|
|
|
|
echo
|
|
echoSuccess "Plugin has been installed, please configure: $project_dir/etc/plugins/$plugin"
|
|
echo
|