#!/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 runPostscripts "$shortname" "commands/install-plugin" echo echoSuccess "Plugin has been installed, please configure: $project_dir/etc/plugins/$plugin" echo