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
nexedi
caddy
Commits
782ba324
Commit
782ba324
authored
May 01, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only a warning if site root doesn't exist
parent
d1181972
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
config/directives.go
config/directives.go
+7
-3
No files found.
config/directives.go
View file @
782ba324
package
config
import
(
"fmt"
"log"
"os"
"os/exec"
...
...
@@ -30,12 +32,14 @@ func init() {
p
.
cfg
.
Root
=
p
.
tkn
()
// Ensure root folder exists
_
,
err
:=
os
.
Stat
(
p
.
cfg
.
Root
)
_
,
err
:=
os
.
Open
(
p
.
cfg
.
Root
)
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
return
p
.
err
(
"Path"
,
"Root path "
+
p
.
cfg
.
Root
+
" does not exist"
)
// Allow this, because the folder might appear later.
// But make sure the user knows!
log
.
Printf
(
"Warning: Root path %s does not exist"
,
p
.
cfg
.
Root
)
}
else
{
return
p
.
err
(
"Path"
,
"Unable to access root path "
+
p
.
cfg
.
Root
)
return
p
.
err
(
"Path"
,
fmt
.
Sprintf
(
"Unable to access root path '%s': %s"
,
p
.
cfg
.
Root
,
err
.
Error
())
)
}
}
return
nil
...
...
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