Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
coreospackage
Commits
ed14dbde
Commit
ed14dbde
authored
7 years ago
by
Sandeep S. Shewalkar
Browse files
Options
Downloads
Plain Diff
Merge branch 'FIleHelper_SSS' into 'master'
File helper changes See merge request
!26
parents
cce57481
834df8a7
Branches
Branches containing commit
1 merge request
!26
File helper changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
filehelper/fileHelper.go
+10
-4
filehelper/fileHelper.go
with
10 additions
and
4 deletions
filehelper/fileHelper.go
+
10
−
4
View file @
ed14dbde
...
...
@@ -5,6 +5,7 @@ import (
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
...
...
@@ -239,10 +240,15 @@ func Unzip(archive, target string) error {
}
for
_
,
file
:=
range
reader
.
File
{
path
:=
filepath
.
Join
(
target
,
file
.
Name
)
if
file
.
FileInfo
()
.
IsDir
()
{
filePath
:=
filepath
.
Join
(
target
,
file
.
Name
)
parentPath
:=
path
.
Dir
(
CleanPath
(
filePath
))
if
!
FileAvailabilityCheck
(
parentPath
)
{
CreateDirectoryRecursive
(
parentPath
)
}
os
.
MkdirAll
(
path
,
file
.
Mode
())
if
file
.
FileInfo
()
.
IsDir
()
{
os
.
MkdirAll
(
filePath
,
file
.
Mode
())
continue
}
...
...
@@ -252,7 +258,7 @@ func Unzip(archive, target string) error {
return
openError
}
targetFile
,
targetOpenError
:=
os
.
OpenFile
(
p
ath
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
,
file
.
Mode
())
targetFile
,
targetOpenError
:=
os
.
OpenFile
(
fileP
ath
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
,
file
.
Mode
())
if
targetOpenError
!=
nil
{
logginghelper
.
LogError
(
targetOpenError
)
return
targetOpenError
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets