Skip to content

Commit

Permalink
Merge pull request #48 from jj05y/task/removing-wds
Browse files Browse the repository at this point in the history
Removing un-needed WorkingDirectories input parameter
  • Loading branch information
jj05y authored Jun 30, 2021
2 parents 4b4b977 + bd5c7fc commit 60614ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Then in .csproj add a Target.

## Options

_WorkingDirectory_ is the input directory of the c# dtos

_WorkingDirectories_ is an option for passing multiple input directories of c# dtos (seperated with ;)
_WorkingDirectory_ is the input directory of the c# dtos (seperate multiple directories with ';')

_ConvertDirectory_ is the output directory of the ts interfaces

Expand Down Expand Up @@ -142,12 +140,10 @@ It correctly converts the following C# types to the equivalent typescript:

**If a _Convert Directory_ is supplied, it will be deleted everytime script is ran and will be remade**

**If a _Working Directory_ is supplied along with a list of _Working Directories_ they will all be considered for conversion**

Comments like `//` are ignored in c# files. Comments like `/* */` could cause undefined behavior.

Tested on Windows 10, macOS Big Sur, and Ubuntu 18.04

Follows the case and naming conventions of each language.

Thanks to natemcmaster [this project](https://github.com/natemcmaster/msbuild-tasks) really helped me out!
Thanks to natemcmaster [this project](https://github.com/natemcmaster/msbuild-tasks) really helped me out!
10 changes: 3 additions & 7 deletions Source/MTT/ConvertService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ public class ConvertService

/// <summary>
/// The current working directory for the convert process
/// Seperate multiple directories with ';'
/// </summary>
public string WorkingDirectory { get; set; }

/// <summary>
/// A list of ';' seperated directories for the convert process
/// </summary>
public string WorkingDirectories { get; set; }

/// <summary>
/// The directory to save the ts models
/// </summary>
Expand Down Expand Up @@ -130,14 +126,14 @@ private void GetWorkingDirectories()
{
var dir = Directory.GetCurrentDirectory();

if (string.IsNullOrEmpty(WorkingDirectory) && string.IsNullOrEmpty(WorkingDirectories))
if (string.IsNullOrEmpty(WorkingDirectory))
{
log("Using Default Working Directory {0}", dir);
LocalWorkingDirs.Add(dir);
return;
}

List<string> workingDirectories = $"{WorkingDirectory};{WorkingDirectories}".Split(';').ToList();
List<string> workingDirectories = WorkingDirectory.Split(';').ToList();

foreach (string workingDirectory in workingDirectories) {
if (string.IsNullOrWhiteSpace(workingDirectory)){
Expand Down

0 comments on commit 60614ca

Please sign in to comment.