Skip to content

rename_files breaks with . in old or new #1969

Closed
@jonthegeek

Description

I'm not sure how to create a complete reprex for this. I definitely recommend making sure everything is committed in whatever directory you're using if you're in a real project.

I was trying to organize a directory better, and had the idea of using "." within some filenames. It wouldn't have actually sorted how I want, but I would have seen that when I tried.

Except it truncated at the ., so

rename_files("generate_security", "generate_pkg.security")

was treated as

rename_files("generate_security", "generate_pkg")

Once I ran it it made sense, but I wasn't expecting it, and it made a mess of some things. I think I've recovered everything, but it would definitely be possible to lose work.

I'd recommend either requiring a confirmation if anything other than .R would be truncated, and/or maybe requiring that all work be checked in before running (rather than just checking for using git).

I can probably PR if you'd like to implement this. Let me know if you have a preference for what to implement.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions