File tree Expand file tree Collapse file tree 2 files changed +41
-18
lines changed Expand file tree Collapse file tree 2 files changed +41
-18
lines changed Original file line number Diff line number Diff line change @@ -38,24 +38,7 @@ export GIT_REPO_URL=file://`pwd`/tmp/index-bare
38
38
export GIT_REPO_CHECKOUT=`pwd`/tmp/index-co
39
39
```
40
40
41
- ### Set up the git index
42
-
43
- First, run these commands in this repository's checkout to create a blank index:
44
-
45
- ```
46
- mkdir -p tmp
47
- git init --bare tmp/index-bare
48
- git clone tmp/index-bare tmp/index-co
49
- touch tmp/index-co/.git/git-daemon-export-ok
50
- ```
51
-
52
- Second, configure cargo to publish to your local registry by adding this to your
53
- local ` ~/.cargo/config `
54
-
55
- ```
56
- [registry]
57
- index = "http://localhost:8888/git/index"
58
- ```
41
+ To set up the git index, run ` ./script/init-local-index.sh ` .
59
42
60
43
## Running
61
44
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ if [ -d tmp/index-bare ]; then
6
+ echo tmp/index-bare already exists, exiting
7
+ exit 0
8
+ fi
9
+
10
+ mkdir -p tmp
11
+ rm -rf tmp/index-bare tmp/index-co
12
+
13
+ echo " Initializing repository in tmp/index-bare..."
14
+ git init -q --bare tmp/index-bare
15
+
16
+ echo " Creating checkout in tmp/index-bare..."
17
+ git init -q tmp/index-co
18
+ cd tmp/index-co
19
+ cat > config.json << -EOF
20
+ {
21
+ "dl": "http://localhost:8888/api/v1/crates",
22
+ "api": "http://localhost:8888/"
23
+ }
24
+ EOF
25
+ git add config.json
26
+ git commit -qm ' Initial commit'
27
+ git remote add origin ../index-bare
28
+ git push -q origin master -u > /dev/null
29
+ cd ../..
30
+ touch tmp/index-co/.git/git-daemon-export-ok
31
+
32
+ cat - << -EOF
33
+ Please add the following to your HOME/.cargo/config:
34
+
35
+ [registry]
36
+ index = "http://localhost:8888/git/index"
37
+
38
+ You will also need to generate a token from in the app itself
39
+ EOF
40
+
You can’t perform that action at this time.
0 commit comments