From 7a77c84abeac7f4f3267054a3b2fe3ecafe55b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 27 Oct 2017 17:09:21 +0200 Subject: [PATCH 1/3] Add a link.sh script to ease debugging Flex apps --- link.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 link.sh diff --git a/link.sh b/link.sh new file mode 100755 index 0000000000000..4d87250f215d5 --- /dev/null +++ b/link.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Link dependencies to components to a local clone of the monolithic Symfony repository +# author: Kévin Dunglas + +if [ $# -eq 0 ] +then + echo "Link dependencies to components to a local clone of the monolithic Symfony repository" + echo "" + echo "Usage: ./link.sh /path/to/the/project" + exit +fi + +# Can't use maps because Mac OS doesn't ship Bash 4 by default... +declare -a dirs names + +for dir in $(find $(pwd)/src/Symfony/{Bundle,Bridge,Component} -type d -maxdepth 1 -mindepth 1) +do + dirs+=($dir) + names+=($(cat $dir/composer.json | egrep -o '"name": "symfony/[a-zA-Z0-9-]+"' | egrep -o 'symfony/[a-zA-Z0-9-]+')) +done + +for vendor in $(find $1/vendor/symfony -type d -maxdepth 1 -mindepth 1) +do + vendorName=$(echo $vendor | rev | cut -sd / -f -2 | rev) + for i in "${!names[@]}" + do + name=${names[$i]} + + if [ "$name" = "$vendorName" ] + then + mv $vendor $vendor.back + ln -s ${dirs[$i]} $vendor + echo "$vendorName linked to ${dirs[$i]}" + fi + done +done From 5353834c48adbbf042a121047d49ee1236cbb6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 27 Oct 2017 22:09:15 +0200 Subject: [PATCH 2/3] Add a continue --- link.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/link.sh b/link.sh index 4d87250f215d5..8ac6a333df491 100755 --- a/link.sh +++ b/link.sh @@ -31,6 +31,7 @@ do mv $vendor $vendor.back ln -s ${dirs[$i]} $vendor echo "$vendorName linked to ${dirs[$i]}" + continue fi done done From 4e1e1faccb01c79c1a4e51c7f51a64712121a2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 27 Oct 2017 22:09:48 +0200 Subject: [PATCH 3/3] Remove useless comment --- link.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/link.sh b/link.sh index 8ac6a333df491..95ea262825c8f 100755 --- a/link.sh +++ b/link.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Link dependencies to components to a local clone of the monolithic Symfony repository -# author: Kévin Dunglas +# Author: Kévin Dunglas if [ $# -eq 0 ] then