This script converts the file extensions of files in a specified directory or the current directory if no target is provided. It supports specifying the current and new file extensions, as well as the target directory.
- Convert file extensions in a specified directory or the current directory.
- Specify the current file extension and the new file extension.
- Optionally specify the target directory with
--target
argument. - Script scans all files, including nested folders and files.
To make the save.sh
script executable on your computer, you need to set the executable permission for the file. You can do this using the chmod
command. Here's how:
chmod +x convert.sh
This command will run the script, converting all .vue files to .ts files in the specified src/template directory.
test@computer % ./convert.sh --current_ext vue --new_ext ts --target src/template
This command will run the script, converting all .ts files to .vue files in the current directory.
test@computer % ./convert.sh --current_ext ts --new_ext vue