Merge pull request #289 from TouchInstinct/fix/add_custom_enviroment

Add user defined enviroment for copy-paste decetion script
This commit is contained in:
Александр 2021-12-01 16:01:38 +03:00 committed by GitHub
commit d2ce219af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,13 @@
# Description:
# Add user defined enviroment if programm not found
#
# Parameters:
# $1 - programm
#
# Examples of usage:
# . install_env.sh pmd
#
# When you run Git from the command line, it runs in the environment as set up by your Shell.
# GUI OS X apps, however, have no knowledge about your shell - and the PATH environment can be changed in many different places.
# Export our profile with path by ourselves
@ -8,6 +18,8 @@ function source_home_file {
}
# Use specific exec due to Xcode has custom value of $PATH
if [ -z "$(which pmd)" ]; then
if [ -z "$(which $1)" ]; then
source_home_file ".bash_profile" || source_home_file ".zshrc" || true
echo "User defined enviroment has been set for ${1}"
fi

View File

@ -24,6 +24,8 @@
readonly EXIT_SUCCESS=0
readonly EXIT_FAILURE=1
. ${SCRIPT_DIR}/../aux_scripts/install_env.sh pmd
if which pmd >/dev/null; then
readonly REPORTS_DIR="${PROJECT_DIR}/code-quality-reports"