Skip to content

Running alitv.pl twice with overwrite results in an error #150

Description

@iimog

When I run alitv.pl test.yml --overwrite repeatedly it works twice and then fails. The reason is that the first time the test.map file does not exist so no need to overwrite at all. The second time a test.map file exists and is backuped to test.map.bak and then overwritten. In all consecutive runs both the test.map and test.map.bak files exist and AliTV refuses to overwrite test.map.bak.

This behavior is not intuitive. For me setting the --overwrite flag explicitly means "please overwrite all existing, conflicting files". Therefore I would not even expect a .bak file to be created. And if it is created I wont expect it to cause consecutive runs to fail. I'd vote for not creating a backup file at all and this problem should be solved.

Activity

  1. iimog commented on Apr 4, 2019

    @iimog
    MemberAuthor

    @greatfireball if you agree I suggest removing the .bak file creation step completely. So simple behavior:

    • If the output file exists and --overwrite is not given: fail and do not overwrite
    • If the output file exists and --overwrite is given: just overwrite it and continue

    I'm happy to provide a pr for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions