MCPcopy Create free account
hub / github.com/devspace-sh/devspace / createAllFolders

Method createAllFolders

pkg/devspace/sync/tar.go:167–188  ·  view source on GitHub ↗
(name string, perm os.FileMode)

Source from the content-addressed store, hash-verified

165}
166
167func (u *Unarchiver) createAllFolders(name string, perm os.FileMode) error {
168 absPath, err := filepath.Abs(name)
169 if err != nil {
170 return err
171 }
172
173 slashPath := filepath.ToSlash(absPath)
174 pathParts := strings.Split(slashPath, "/")
175 for i := 1; i < len(pathParts); i++ {
176 dirToCreate := strings.Join(pathParts[:i+1], "/")
177 err := os.Mkdir(dirToCreate, perm)
178 if err != nil {
179 if os.IsExist(err) {
180 continue
181 }
182
183 return errors.Errorf("Error creating %s: %v", dirToCreate, err)
184 }
185 }
186
187 return nil
188}
189
190// Archiver is responsible for compressing specific files and folders within a target directory
191type Archiver struct {

Callers 1

untarNextMethod · 0.95

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected