-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from DEploid-dev/issue309
resolve #309
- Loading branch information
Showing
3 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
|
||
#if [ ! -z "$src_dir+x" ]; then | ||
src_dir=$PWD/src | ||
#fi | ||
|
||
if [ ! -f "${src_dir}/dEploid.cpp" ]; then | ||
"Error: please execute \".checkfiles.sh\" from DEploid root directory" | ||
exit 1 | ||
fi | ||
|
||
|
||
OS=`uname -s` | ||
#echo "operating system is ${OS}" | ||
# VERSION=$(cat VERSION | tr -d '\n') | ||
VERSION=0.1-release | ||
echo -n "." # echo "ok not git clone, now check plot and figure" | ||
|
||
#rm master.tar.gz # just making sure download the one we actually want to | ||
|
||
extract_submodule_from(){ | ||
account=$1 | ||
submodule=$2 | ||
placeto=$3 | ||
echo "Extract submodule $submodule from account $account, place at $3" | ||
if [ ! -d ${submodule}_dir ]; then mkdir ${submodule}_dir; fi | ||
echo -n "." # echo "ok, do something" # | ||
|
||
if [[ "${OS}" == "Linux" ]]; then | ||
wget --no-check-certificate https://github.com/${account}/${submodule}/archive/v${VERSION}.tar.gz -o /dev/null | ||
elif [[ "${OS}" == "Darwin"* ]]; then | ||
curl -LOk https://github.com/${account}/${submodule}/archive/v${VERSION}.tar.gz | ||
else | ||
echo "Unknown OS, fail to download package from https://github.com/${account}/${submodule}/archive/v${VERSION}.tar.gz" | ||
echo "Please contact Joe at [email protected] if assistance is needed" | ||
exit 1 | ||
fi | ||
ls *gz | ||
|
||
if [ ! -f v${VERSION}.tar.gz ]; then | ||
echo "Error: Download package from https://github.com/${account}/${submodule}/archive/v${VERSION}.tar.gz failed" | ||
echo "Please contact Joe at [email protected] if assistance is needed" | ||
exit 1 | ||
fi | ||
tar -xf v${VERSION}.tar.gz -C ${submodule}_dir | ||
if [ ! -d ${placeto} ]; then mkdir ${placeto}; fi | ||
cp -r ${submodule}_dir/${submodule}-${VERSION}/* ${placeto}/ | ||
rm -r ${submodule}_dir v${VERSION}.tar.gz | ||
} | ||
|
||
|
||
ACCOUNT=DEploid-dev | ||
SUBMODLUE=DEploid-Utilities | ||
PLACETO=utilities | ||
tmp_dir=$PWD/utilities | ||
if [ -f ${tmp_dir}/DEploidR.R -a -f ${tmp_dir}/dEploidTools.r ];then | ||
echo -n "." # echo "ok, do nothing" | ||
else | ||
extract_submodule_from $ACCOUNT $SUBMODLUE $PLACETO | ||
fi | ||
|
||
ACCOUNT=shajoezhu | ||
SUBMODLUE=DEploid-Lasso-lib | ||
PLACETO=$PWD/src/lasso | ||
tmp_dir=$PWD/src/lasso | ||
if [ -f ${tmp_dir}/main.cpp -a -f ${tmp_dir}/README.md ];then | ||
echo -n "." # echo "ok, do nothing" | ||
else | ||
extract_submodule_from $ACCOUNT $SUBMODLUE $PLACETO | ||
fi |