CopyConf 1.5.3.1

dotnet tool install --global CopyConf --version 1.5.3.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local CopyConf --version 1.5.3.1                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CopyConf&version=1.5.3.1                
nuke :add-package CopyConf --version 1.5.3.1                

CopyConf

A command line tool to copy default config files from a specified location to an output directory. Use this in your post-build event to automatically add default configuration files that can be modified in your local development environment.

Installation

Add via dotnet CLI dotnet tool install copyconf -g

How it works

Typically, you would like to distribute default config files for your app but you don't want developers to push their local versions of the files to the remote repository. CopyConf takes files ending with .dist and renames them to the correct file name after copying to the destination.

Consider the directory structure for a solution below:


SolutionDir
   |-- conf
   |    |-- environment.config.dist
   |    |-- connections.Development.json.dist
   |    |-- appsettings.Development.json.dist
   |    |-- build.yaml.dist
   |-- src
   |    |-- MyAspNetProject
   |    |       |-- MyAspNetProject.csproj
   |    |-- MySolution.sln

Running CopyConf under the folder 'MyAspNetProject' where the csproj file is located will copy files ending in .dist to the current working directory.

Usage

Add it as a pre/post-build command in your .csproj file:


<Target Name="PreBuild" AfterTargets="PreBuildEvent">
   <Exec Command="copyconf &quot;$(SolutionDir)conf&quot; &quot;$(ProjectDir)&quot;" Condition="'$(Configuration)' == 'Debug' />
</Target>

OR manually run on the command line:


   $> copyconf "C:/project/conf" "C:/project/src/MyWebProject"

Arguments, Switches and Options


Usage: copyconf [options] <sourceDir> <destinationDir>

Arguments:
  sourceDir        "/path/to/source" The path to the directory where default
                   content will be copied from.
  destinationDir   "/path/to/dest" The path to the directory where files will be
                   copied to

Options:
  -?|-h|--help     Show help information.
  -e|--extensions  [OPTIONAL] Supported file extensions delimited by semi-colon.
                   Defaults to: ".conf;.config;.json;.yaml;.yml;.xml;.env"
  -r|--rootonly    [OPTIONAL] Prevent files in subdirectories from being copied
  -f|--force       [OPTIONAL] Force create destination directory when it doesn't
                   exist.
  -v|--verbose     [OPTIONAL] Verbose mode.

Syntax:  
  copyconf sourceDir destinationDir [--extensions=".conf;.config;.json;.yaml;.yml;.xml;.env"] [--rootonly] [--force]

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.5.3.1 77 5/3/2024
0.5.1 546 3/3/2022
0.0.5 475 7/21/2021
0.0.4 1,306 6/17/2019
0.0.3 2,604 5/31/2018
0.0.2 855 5/11/2018
0.0.1 1,008 4/13/2018