Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
allowing setup.sh to accept local overrides for the files that are setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Orcutt committed Mar 22, 2018
1 parent 8b6e7db commit 678c37e
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ add_to_git_ignore()

}

skeleton_find()
{
projectRoot=$1
skeletonRoot=$2
skeletonFile=$3
localSkeletonRoot="$projectRoot/src/skeleton"
localFile="$localSkeletonRoot/$skeletonFile"
skeletonFile="$skeletonRoot/$skeletonFile"
if [ -f $localFile ]; then
#echo "skeletonFind usingSkeleton=$localFile"
echo $localFile;
return 0;
fi
#echo "skeletonFind usingSkeleton=$skeletonFile"
echo $skeletonFile;
return 0;
}

copy_from_skeleton()
{
projectRoot=$1
Expand Down Expand Up @@ -57,7 +75,7 @@ setup_dir()
mkdir -p $targetDir
else
echo " setupDir - targetDir=$targetDir - aok"
return
return;
fi

if [ ! -d $targetDir ]; then
Expand Down Expand Up @@ -95,35 +113,55 @@ add_to_git_ignore $project_root "tmp";
echo "Copying in files from project skeleton"

# Copy over our hhconfig
hhConfigFile=$(skeleton_find $project_root $skeleton_root ".hhconfig")
echo " hhConfigSkeleton=$hhConfigFile"

copy_from_skeleton \
$project_root \
"$skeleton_root/.hhconfig" \
$hhConfigFile \
"$project_root/.hhconfig"

add_to_git_ignore $project_root ".hhconfig"


echo " --------------------------------------------------------------------------------"
# Copy over our makefile
makeFile=$(skeleton_find $project_root $skeleton_root "Makefile")
echo " makeFile=$makeFile"

copy_from_skeleton \
$project_root \
"$skeleton_root/Makefile" \
$makeFile \
"$project_root/Makefile"

add_to_git_ignore $project_root "Makefile"

echo " --------------------------------------------------------------------------------"

# copy over the bootstrap file
bootstrapFile=$(skeleton_find $project_root $skeleton_root "bootstrap")
echo " bootstrap=$bootstrapFile"

copy_from_skeleton \
$project_root \
"$skeleton_root/bootstrap" \
$bootstrapFile \
"$project_root/bootstrap.hh"

add_to_git_ignore $project_root "bootstrap.hh"

echo " --------------------------------------------------------------------------------"

# copy over the phpunit.xml config
phpunitFile=$(skeleton_find $project_root $skeleton_root "phpunit.xml")
echo " phpunitFile=$phpunitFile"

copy_from_skeleton \
$project_root \
"$skeleton_root/phpunit.xml" \
"$project_root/phpunit.xml"

add_to_git_ignore $project_root "phpunit.xml"

echo " --------------------------------------------------------------------------------"

echo "DONE"

0 comments on commit 678c37e

Please sign in to comment.