Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
boilr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
boilr
Commits
4bf5327c
Commit
4bf5327c
authored
8 years ago
by
Tamer Tas
Browse files
Options
Downloads
Patches
Plain Diff
Allow traversal for rendered directories
parent
dc59b93e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/template/template.go
+1
-1
1 addition, 1 deletion
pkg/template/template.go
pkg/util/osutil/fs.go
+3
-3
3 additions, 3 deletions
pkg/util/osutil/fs.go
with
4 additions
and
4 deletions
pkg/template/template.go
+
1
−
1
View file @
4bf5327c
...
...
@@ -198,7 +198,7 @@ func (t *dirTemplate) Execute(dirPrefix string) error {
target
:=
filepath
.
Join
(
dirPrefix
,
newName
)
if
info
.
IsDir
()
{
if
err
:=
os
.
Mkdir
(
target
,
07
44
);
err
!=
nil
{
if
err
:=
os
.
Mkdir
(
target
,
07
55
);
err
!=
nil
{
if
!
os
.
IsExist
(
err
)
{
return
err
}
...
...
This diff is collapsed.
Click to expand it.
pkg/util/osutil/fs.go
+
3
−
3
View file @
4bf5327c
...
...
@@ -46,7 +46,7 @@ func DirExists(path string) (bool, error) {
// CreateDirs creates directories from the given directory path arguments.
func
CreateDirs
(
dirPaths
...
string
)
error
{
for
_
,
path
:=
range
dirPaths
{
if
err
:=
os
.
MkdirAll
(
path
,
07
44
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
path
,
07
55
);
err
!=
nil
{
return
err
}
}
...
...
@@ -57,7 +57,7 @@ func CreateDirs(dirPaths ...string) error {
// CopyRecursively copies a given directory to the destination.
// Creates the directory if the destination doesn't exist.
func
CopyRecursively
(
srcPath
,
dstPath
string
)
error
{
if
err
:=
os
.
Mkdir
(
dstPath
,
07
44
);
err
!=
nil
{
if
err
:=
os
.
Mkdir
(
dstPath
,
07
55
);
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
return
fmt
.
Errorf
(
"directory %q doesn't exist"
,
filepath
.
Dir
(
dstPath
))
}
...
...
@@ -80,7 +80,7 @@ func CopyRecursively(srcPath, dstPath string) error {
mirrorPath
:=
filepath
.
Join
(
dstPath
,
relPath
)
if
info
.
IsDir
()
{
if
err
:=
os
.
Mkdir
(
mirrorPath
,
0744
);
err
!=
nil
{
if
err
:=
os
.
Mkdir
(
mirrorPath
,
info
.
Mode
()
);
err
!=
nil
{
if
!
os
.
IsExist
(
err
)
{
return
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment