mirror of
https://github.com/samuelncui/yatm.git
synced 2026-04-28 11:27:37 +00:00
fix: backup file under root dir
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user