Faithlife.FindReplaceCode.Tool
1.3.0
Prefix Reserved
dotnet tool install --global Faithlife.FindReplaceCode.Tool --version 1.3.0
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local Faithlife.FindReplaceCode.Tool --version 1.3.0
#tool dotnet:?package=Faithlife.FindReplaceCode.Tool&version=1.3.0
nuke :add-package Faithlife.FindReplaceCode.Tool --version 1.3.0
FindReplaceCode
Used to generate a new code project from a template.
Documentation | Release Notes | Contributing
WARNING: This tool is recursively destructive. Please be extremely careful with it.
This tool is installed as a dotnet tool: dotnet tool install Faithlife.FindReplaceCode.Tool --global
.
Usage
Usage: findreplacecode <folder-path> <find> <replace> [<find> <replace> ...]
For example:
> findreplacecode C:\Code\MyItemApi MyItem CoolThing
Folder Path
The first argument is the folder path. This tool may edit and/or rename every file and every folder in that folder and all of its subfolders, so be very careful where you point it.
Normally you would point the tool at a folder where you have made a copy of a project or solution that you want to modify.
Find and Replace
Each pair of arguments after the folder path indicate text to find and text to replace it with.
The find-and-replace is executed not only on the content of code files, but it is also used to rename files and folders.
This tool also creates new a Visual Studio project GUID for each renamed .csproj
and automatically substitutes that project GUID in any .sln
file that references the old one.
The find-and-replace is case-sensitive, but certain case variants are automatically replaced. For example, if you replace "MyItem" with "CoolThing", these replacements will also be executed: "myItem" for "coolThing", "myitem" for "coolthing", and "MYITEM" for "COOLTHING".
If the find text is not sufficiently unique in the existing files, this tool may not work well. For example, replacing Project
would break Visual Studio project and solution files. This tool isn't that smart.
At least one find-and-replace pair is required. Any additional pairs are executed in the order they are provided.
Any .git
subfolders are automatically excluded from modification.
Issues
Only certain file extensions are currently considered for content replacement. Please let us know if there are others that should be added.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
1.3.0 | 90 | 11/26/2024 |
1.2.0 | 163 | 2/16/2024 |
1.1.0 | 808 | 4/29/2019 |
1.0.0 | 713 | 3/13/2019 |
1.0.0-beta1 | 738 | 9/10/2018 |