Skip to content

Commit

Permalink
fix: backup file under root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelncui committed Oct 21, 2023
1 parent ecfce73 commit 51f88fe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion executor/job_archive_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (a *jobArchiveExecutor) applyParam(ctx context.Context, param *entity.JobAr
sources := make([]*entity.SourceState, 0, len(param.Sources)*8)
for _, src := range param.Sources {
src.Base = strings.TrimSpace(src.Base)
if src.Base[0] != '/' {
if src.Base == "" || src.Base[0] != '/' {
src.Base = path.Join(a.exe.paths.Source, src.Base) + "/"
}
a.logger.Infof("walk source start, source_path= '%s'", src.RealPath())
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ const useBackupTargetBrowser = () => {
let splitIdx = path.lastIndexOf("/");
if (splitIdx < 0) {
splitIdx = -1
return;
}

return { base: path.slice(0, splitIdx + 1), path: [path.slice(splitIdx + 1)] } as Source;
Expand Down

0 comments on commit 51f88fe

Please sign in to comment.