Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Rename file on copy #81

Open
UrsineRaven opened this issue Jan 24, 2020 · 4 comments
Open

Feature Request: Rename file on copy #81

UrsineRaven opened this issue Jan 24, 2020 · 4 comments

Comments

@UrsineRaven
Copy link

UrsineRaven commented Jan 24, 2020

Request

I would like to be able to rename a file when I copy it. The easiest way may be to just have a flag that means copy this file to this path/filename. You could also just check if there's one input file, check if the destination folder is actually a file, and replace it if it is.

Optional multi-file support proposal

If you still wanted to support copying globs or multiple files, the destination name could have a wildcard and you could just replace the wildcard with the matched name.

Use-case

I have a project that uses a file (.env) to store certain configuration options. I have an npm script that deploys my project, but it needs to first replace the config file with one that has the configuration options needed for deployment (.env_publish) which is currently stored in the same folder. I would like to use this package since it's super light-weight. 😄

What I'm currently trying to do: copyfiles .env_publish .env

Existing Work-around

I am aware that I can just create subfolders, and keep all config files named .env, so that when I copy them I don't have to rename them, but I would like to keep them all in the same folder.

@mesqueeb
Copy link

My use case is I want to rename files upon copy as well. There's so many use cases, clean up casing etc.
🎉

@mesqueeb
Copy link

@calvinmetcalf do you you this idea? : ) do you wanna implement it?

@xyunsh
Copy link

xyunsh commented Feb 25, 2024

I need this

@xyunsh
Copy link

xyunsh commented Feb 25, 2024

cp .env_publish .env

it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants