Skip to content

Commit 91cde3a

Browse files
committed
Apply PR comments
1 parent 174b510 commit 91cde3a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ introduced to manage template sources within a project.
8787

8888
### Usage
8989

90-
add <NAME> <URL> <BRANCH> Adds a Git remote to the local config
91-
remove <NAME> Removes Git remotes
92-
use <NAME> Uses the given remote by default
90+
moryx remotes add <NAME> <URL> <BRANCH> Adds a Git remote to the local config
91+
moryx remotes remove <NAME> Removes Git remotes
92+
moryx remotes use <NAME> Uses the given remote by default
9393

9494
### Examples
9595

src/Moryx.Cli.Commands/Extensions/ConfigExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Moryx.Cli.Commands.Extensions
55
{
66
public static class ConfigExtensions
77
{
8-
public static TemplateSettings AsTemplateSettings(this Config.Models.Configuration configuration, string dir, string solutionName, string profile = null)
8+
public static TemplateSettings AsTemplateSettings(this Config.Models.Configuration configuration, string dir, string solutionName, string profile = "")
99
{
1010
profile = string.IsNullOrEmpty(profile) ? configuration.DefaultProfile : profile;
1111
return new()

src/Moryx.Cli.Templates/Extensions/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static string ReplaceFileExtension(this string str, string oldStr, string
2626

2727
public static string StateBase(this string str) => str + "StateBase";
2828

29-
public static string FileSystemCompatible(this string url)
29+
public static string AsFolderName(this string url)
3030
{
3131
var pattern = @"[\:\/\?\#\[\]\!\$\&\'\(\)\*\+\,\;\=]";
3232
url = Regex.Replace(url, pattern, "_");

src/Moryx.Cli.Templates/Models/TemplateSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class TemplateSettings
1010
public required string AppName { get; set; }
1111
public string ProfileName { get; set; } = "default";
1212
public required string TargetDirectory { get; set; }
13-
public string SourceDirectory { get => Path.Combine(TemplatesRoot(), Repository.FileSystemCompatible(), Branch); }
13+
public string SourceDirectory { get => Path.Combine(TemplatesRoot(), Repository.AsFolderName(), Branch); }
1414

1515

1616
public string TemplatesRoot()

src/Tests/Moryx.Cli.Tests/FileSystemCompatibleUrlTests.cs renamed to src/Tests/Moryx.Cli.Tests/TemplateStringExtensionsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Moryx.Cli.Tests
44
{
5-
public class FileSystemCompatibleUrlTests
5+
public class TemplateStringExtensionsTests
66
{
77

88
[SetUp]
@@ -14,7 +14,7 @@ public void Setup()
1414
[TestCase("ssh://[email protected]:microsoft/vscode.git", "[email protected]_microsoft_vscode.git")]
1515
public void CheckUrlConversion(string input, string expected)
1616
{
17-
var result = input.FileSystemCompatible();
17+
var result = input.AsFolderName();
1818

1919
Assert.That(result, Is.EqualTo(expected));
2020
}

0 commit comments

Comments
 (0)