mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-05-04 20:10:36 +00:00
fix: allow --stdin-from-command flag to be used
This commit is contained in:
@@ -134,6 +134,10 @@ func validatePlan(plan *v1.Plan, repos map[string]*v1.Repo) error {
|
||||
}
|
||||
}
|
||||
|
||||
hasStdinFromCommand := slices.Contains(plan.BackupFlags, "--stdin-from-command")
|
||||
if len(plan.Paths) == 0 && !hasStdinFromCommand {
|
||||
err = multierror.Append(err, fmt.Errorf("at least one path is required (unless --stdin-from-command is used)"))
|
||||
}
|
||||
for idx, p := range plan.Paths {
|
||||
if p == "" {
|
||||
err = multierror.Append(err, fmt.Errorf("path[%d] cannot be empty", idx))
|
||||
|
||||
@@ -194,9 +194,6 @@ export const AddPlanModal = ({ template }: { template: Plan | null }) => {
|
||||
if (!formData.repo) {
|
||||
throw new Error(m.add_plan_modal_validation_repository_required());
|
||||
}
|
||||
if (!formData.paths || formData.paths.length === 0) {
|
||||
throw new Error(m.add_plan_modal_validation_paths_required());
|
||||
}
|
||||
if (
|
||||
formData.backup_flags &&
|
||||
formData.backup_flags.some((f: string) => !/^\-\-?.*$/.test(f))
|
||||
|
||||
Reference in New Issue
Block a user