Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
0d2ed078
Commit
0d2ed078
authored
May 01, 2015
by
Abiola Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified repository path to be relative to root path.
parent
479c6114
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
middleware/git/doc.go
middleware/git/doc.go
+4
-3
middleware/git/git.go
middleware/git/git.go
+3
-2
No files found.
middleware/git/doc.go
View file @
0d2ed078
...
@@ -13,8 +13,9 @@
...
@@ -13,8 +13,9 @@
// and https(e.g. https://github.com/user/project) are supported.
// and https(e.g. https://github.com/user/project) are supported.
// Can be specified in either config block or top level
// Can be specified in either config block or top level
//
//
// path - directory to pull into
// path - directory to pull into
, relative to site root
// optional. Defaults to site root.
// optional. Defaults to site root.
// If set, must be a subdirectory to site root to be valid.
//
//
// branch - git branch or tag
// branch - git branch or tag
// optional. Defaults to master
// optional. Defaults to master
...
@@ -30,10 +31,10 @@
...
@@ -30,10 +31,10 @@
// public repo pulled into site root
// public repo pulled into site root
// git github.com/user/myproject
// git github.com/user/myproject
//
//
// public repo pulled into mysite
// public repo pulled into
<root>/
mysite
// git https://github.com/user/myproject mysite
// git https://github.com/user/myproject mysite
//
//
// private repo pulled into mysite with tag v1.0 and interval of 1 day
// private repo pulled into
<root>/
mysite with tag v1.0 and interval of 1 day
// git {
// git {
// repo git@github.com:user/myproject
// repo git@github.com:user/myproject
// branch v1.0
// branch v1.0
...
...
middleware/git/git.go
View file @
0d2ed078
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"github.com/mholt/caddy/middleware"
"github.com/mholt/caddy/middleware"
"net/http"
"net/http"
"net/url"
"net/url"
"path/filepath"
"runtime"
"runtime"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -45,7 +46,7 @@ func parse(c middleware.Controller) (*Repo, error) {
...
@@ -45,7 +46,7 @@ func parse(c middleware.Controller) (*Repo, error) {
switch
len
(
args
)
{
switch
len
(
args
)
{
case
2
:
case
2
:
repo
.
Path
=
args
[
1
]
repo
.
Path
=
filepath
.
Join
(
c
.
Root
(),
args
[
1
])
fallthrough
fallthrough
case
1
:
case
1
:
repo
.
Url
=
args
[
0
]
repo
.
Url
=
args
[
0
]
...
@@ -62,7 +63,7 @@ func parse(c middleware.Controller) (*Repo, error) {
...
@@ -62,7 +63,7 @@ func parse(c middleware.Controller) (*Repo, error) {
if
!
c
.
NextArg
()
{
if
!
c
.
NextArg
()
{
return
nil
,
c
.
ArgErr
()
return
nil
,
c
.
ArgErr
()
}
}
repo
.
Path
=
c
.
Val
(
)
repo
.
Path
=
filepath
.
Join
(
c
.
Root
(),
c
.
Val
()
)
case
"branch"
:
case
"branch"
:
if
!
c
.
NextArg
()
{
if
!
c
.
NextArg
()
{
return
nil
,
c
.
ArgErr
()
return
nil
,
c
.
ArgErr
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment