Skip to content

Commit b187910

Browse files
authored
Logic for Pyomo directory
1 parent 7c56e29 commit b187910

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/compile_solvers.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,18 @@ if [ ${osname} = "darwin" ]; then
452452
export CXX="c++"
453453
fi
454454

455-
# We are already in this directory
456-
git clone $PYNU_REPO
457-
cd pyomo
455+
# Check if the directory exists
456+
if [ ! -d "pyomo" ]; then
457+
# If it doesn't exist, clone the repository
458+
git clone "$PYNU_REPO"
459+
echo "Repository cloned from $PYNU_REPO."
460+
cd pyomo
461+
else
462+
# If it exists, navigate to the directory and run git clean
463+
cd pyomo
464+
git clean -fd
465+
echo "Untracked files removed from pyomo."
466+
fi
458467
git checkout $PYNU_BRANCH
459468
cd pyomo/contrib/pynumero/src
460469
mkdir build

0 commit comments

Comments
 (0)