Skip to content

Commit 55f9940

Browse files
committed
Support passing an alternate URL to pull as a second argument
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 635a18b commit 55f9940

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

README.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ You can also pull a single dependency by specifying its name as the first argume
9191
./vendor/vendorpull/pull depot_tools
9292
```
9393

94+
When pulling a single dependency, you can provide an explicit alternative
95+
location to pull from as a second argument. This is particularly handy if you
96+
want to pull from a local directory without the overhead of hitting an external
97+
git server:
98+
99+
```sh
100+
./vendor/vendorpull/pull my-dependency ../projects/my-dependency
101+
```
102+
94103
Updating
95104
--------
96105

pull

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,15 @@ then
9191
fail "Unknown dependency: $DEPENDENCY"
9292
fi
9393
NAME="$(echo "$LINE" | cut -d ' ' -f 1)"
94-
URL="$(echo "$LINE" | cut -d ' ' -f 2)"
94+
95+
PULL_LOCATION="${2-}"
96+
if [ -n "$PULL_LOCATION" ]
97+
then
98+
URL="$PULL_LOCATION"
99+
else
100+
URL="$(echo "$LINE" | cut -d ' ' -f 2)"
101+
fi
102+
95103
VERSION="$(echo "$LINE" | cut -d ' ' -f 3)"
96104
if [ -z "$NAME" ] || [ -z "$URL" ] || [ -z "$VERSION" ]
97105
then

0 commit comments

Comments
 (0)