这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/internal/cache/cache_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *fsCache) Fetch(target, hash string, _unusedOutputGlobs []string) (bool,
}

// Otherwise, copy it into position
err := fs.RecursiveCopyOrLinkFile(cachedFolder, target, fs.DirPermissions, true, true)
err := fs.RecursiveCopyOrLinkFile(cachedFolder, target, 0, true, true)
if err != nil {
return false, nil, fmt.Errorf("error moving artifact from cache into %v: %w", target, err)
}
Expand All @@ -51,7 +51,7 @@ func (f *fsCache) Put(target, hash string, duration int, files []string) error {
return fmt.Errorf("error ensuring directory file from cache: %w", err)
}

if err := fs.CopyOrLinkFile(file, filepath.Join(f.cacheDirectory, hash, rel), fs.DirPermissions, fs.DirPermissions, true, true); err != nil {
if err := fs.CopyOrLinkFile(file, filepath.Join(f.cacheDirectory, hash, rel), 0, 0, true, true); err != nil {
return fmt.Errorf("error copying file from cache: %w", err)
}
}
Expand Down
18 changes: 9 additions & 9 deletions cli/internal/prune/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ func (c *PruneCommand) Run(args []string) int {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to create folder %v for %v: %w", targetDir, internalDep, err))
return 1
}
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].Dir, targetDir, fs.DirPermissions); err != nil {
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].Dir, targetDir, 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy %v into %v: %w", internalDep, targetDir, err))
return 1
}
if err := fs.EnsureDir(jsonDir); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to create folder %v for %v: %w", jsonDir, internalDep, err))
return 1
}
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].PackageJSONPath, jsonDir, fs.DirPermissions); err != nil {
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].PackageJSONPath, jsonDir, 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy %v into %v: %w", internalDep, jsonDir, err))
return 1
}
Expand All @@ -190,7 +190,7 @@ func (c *PruneCommand) Run(args []string) int {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to create folder %v for %v: %w", targetDir, internalDep, err))
return 1
}
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].Dir, targetDir, fs.DirPermissions); err != nil {
if err := fs.RecursiveCopy(ctx.PackageInfos[internalDep].Dir, targetDir, 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy %v into %v: %w", internalDep, targetDir, err))
return 1
}
Expand All @@ -205,29 +205,29 @@ func (c *PruneCommand) Run(args []string) int {
c.Config.Logger.Trace("new worksapces", "value", workspaces)
if pruneOptions.docker {
if fs.FileExists(".gitignore") {
if err := fs.CopyFile(".gitignore", filepath.Join(pruneOptions.cwd, "out", "full", ".gitignore"), fs.DirPermissions); err != nil {
if err := fs.CopyFile(".gitignore", filepath.Join(pruneOptions.cwd, "out", "full", ".gitignore"), 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy root .gitignore: %w", err))
return 1
}
}

if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "full", "package.json"), fs.DirPermissions); err != nil {
if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "full", "package.json"), 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy root package.json: %w", err))
return 1
}

if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "json", "package.json"), fs.DirPermissions); err != nil {
if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "json", "package.json"), 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy root package.json: %w", err))
return 1
}
} else {
if fs.FileExists(".gitignore") {
if err := fs.CopyFile(".gitignore", filepath.Join(pruneOptions.cwd, "out", ".gitignore"), fs.DirPermissions); err != nil {
if err := fs.CopyFile(".gitignore", filepath.Join(pruneOptions.cwd, "out", ".gitignore"), 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy root .gitignore: %w", err))
return 1
}
}
if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "package.json"), fs.DirPermissions); err != nil {
if err := fs.CopyFile("package.json", filepath.Join(pruneOptions.cwd, "out", "package.json"), 0); err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to copy root package.json: %w", err))
return 1
}
Expand All @@ -238,7 +238,7 @@ func (c *PruneCommand) Run(args []string) int {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to materialize sub-lockfile. This can happen if your lockfile contains merge conflicts or is somehow corrupted. Please report this if it occurs: %w", err))
return 1
}
err = ioutil.WriteFile(filepath.Join(pruneOptions.cwd, "out", "yarn.lock"), next, fs.DirPermissions)
err = ioutil.WriteFile(filepath.Join(pruneOptions.cwd, "out", "yarn.lock"), next, 0)
if err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("Failed to write sub-lockfile: %w", err))
return 1
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/run/run_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (r *RunState) Close(Ui cli.Ui, startAt time.Time, filename string) error {
name = filename
}
if outputPath != "" {
if err := fs.CopyFile(chrometracing.Path(), name, fs.DirPermissions); err != nil {
if err := fs.CopyFile(chrometracing.Path(), name, 0); err != nil {
return err
}
}
Expand Down