Skip to content

Why If --file or --sync-dir is set, the other must also be set? #235

@Araxeus

Description

@Araxeus
  • Why can't I just input --file and then the sync dir will automatically be the parent of the file

  • Why can't I just input --sync-dir and then the file getting logic will be as usual?

If there isn't some particular reason not to change this behavior, it should pretty easy to do here:

peru/peru/runtime.py

Lines 70 to 79 in 9dbf098

if explicit_peru_file and explicit_sync_dir:
self.peru_file = explicit_peru_file
self.sync_dir = explicit_sync_dir
elif explicit_peru_file or explicit_sync_dir:
raise CommandLineError('If the --file or --sync-dir is set, '
'the other must also be set.')
else:
basename = explicit_basename or parser.DEFAULT_PERU_FILE_NAME
self.peru_file = find_project_file(os.getcwd(), basename)
self.sync_dir = os.path.dirname(self.peru_file)

I'm willing to give it a go myself if I get a go ahead

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions