Skip to content

Commit 522f493

Browse files
committed
melting-pot: improve elegance of deps function
Better to change the directory (and back) from within the function.
1 parent 2ec1263 commit 522f493

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

melting-pot.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ retrieveSource() {
285285

286286
# Gets the list of dependencies for the project in the CWD.
287287
deps() {
288+
cd "$1"
288289
mvn dependency:list | grep '^\[INFO\] [^ ]' | sed 's/\[INFO\] //'
290+
cd - > /dev/null
289291
}
290292

291293
# Checks whether the given GA(V) matches the specified filter pattern.
@@ -373,9 +375,7 @@ meltDown() {
373375

374376
# Get the project dependencies.
375377
debug "$1: determining project dependencies"
376-
cd "$dir"
377-
local deps="$(deps)"
378-
cd - > /dev/null
378+
local deps="$(deps "$dir")"
379379

380380
args="-Denforcer.skip"
381381

0 commit comments

Comments
 (0)