We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3142ca commit 49a52b4Copy full SHA for 49a52b4
libraries/util.bash
@@ -713,6 +713,24 @@ function unzipRemoteFile()
713
fi
714
}
715
716
+#################
717
+# GIT UTILITIES #
718
719
+
720
+function getGitRepositoryNameFromCloneURL()
721
+{
722
+ local -r cloneURL="${1}"
723
724
+ checkNonEmptyString "${cloneURL}" 'undefined clone url'
725
726
+ if [[ "$(grep -F -o '@' <<< "${cloneURL}")" != '' ]]
727
+ then
728
+ awk -F '/' '{ print $2 }' <<< "${cloneURL}" | cut -d '.' -f 1
729
+ else
730
+ awk -F '/' '{ print $5 }' <<< "${cloneURL}" | cut -d '.' -f 1
731
+ fi
732
+}
733
734
####################
735
# NUMBER UTILITIES #
736
0 commit comments