Skip to content

Commit 131da60

Browse files
authored
Merge pull request #21 from linksplatform/tools
Change args order. Add auto merge. Update package.
2 parents a556b7d + 4355917 commit 131da60

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

.github/workflows/AutoMerge.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: auto-merge
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
auto-merge:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: ahmadnassri/action-dependabot-auto-merge@v2
12+
with:
13+
target: minor
14+
github-token: ${{ secrets.DEPENDABOT_AUTO_MERGE_TOKEN }}

csharp/Platform.Data.Doublets.Json/JsonExporterCLI.cs renamed to csharp/Platform.Data.Doublets.Json/JsonExporterCli.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ public class JsonExporterCli<TLink>
1717
{
1818
public void Run(params string[] args)
1919
{
20-
var linksFilePath = ConsoleHelpers.GetOrReadArgument(0, "Links file path", args);
21-
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(1, "JSON file path", args);
22-
var documentName = ConsoleHelpers.GetOrReadArgument(2, "Document name", args);
20+
var argumentIndex = 0;
21+
var linksFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "Links file path", args);
22+
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "JSON file path", args);
23+
var defaultDocumentName = Path.GetFileNameWithoutExtension(jsonFilePath);
24+
var documentName = ConsoleHelpers.GetOrReadArgument(argumentIndex, $"Document name (default: {defaultDocumentName})", args);
25+
if (string.IsNullOrWhiteSpace(documentName))
26+
{
27+
documentName = defaultDocumentName;
28+
}
2329
if (!File.Exists(linksFilePath))
2430
{
2531
Console.WriteLine($"${linksFilePath} file does not exist.");

csharp/Platform.Data.Doublets.Json/JsonImporterCli.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ public class JsonImporterCli<TLink>
1717
{
1818
public void Run(params string[] args)
1919
{
20-
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(0, "JSON file path", args);
21-
var documentName = ConsoleHelpers.GetOrReadArgument(1, "Document name", args);
22-
var linksFilePath = ConsoleHelpers.GetOrReadArgument(2, "Links file path", args);
20+
var argumentIndex = 0;
21+
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "JSON file path", args);
22+
var linksFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "Links file path", args);
23+
var defaultDocumentName = Path.GetFileNameWithoutExtension(jsonFilePath);
24+
var documentName = ConsoleHelpers.GetOrReadArgument(argumentIndex, $"Document name (default: {defaultDocumentName})", args);
25+
if (string.IsNullOrWhiteSpace(documentName))
26+
{
27+
documentName = defaultDocumentName;
28+
}
2329
if (!File.Exists(jsonFilePath))
2430
{
2531
Console.WriteLine($"${jsonFilePath} file does not exist.");

csharp/Platform.Data.Doublets.Json/Platform.Data.Doublets.Json.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>LinksPlatform's Platform.Data.Doublets.Json Class Library</Description>
55
<Copyright>FreePhoenix888</Copyright>
66
<AssemblyTitle>Platform.Data.Doublets.Json</AssemblyTitle>
7-
<VersionPrefix>0.0.2</VersionPrefix>
7+
<VersionPrefix>0.1.0</VersionPrefix>
88
<Authors>FreePhoenix888</Authors>
99
<TargetFramework>net5</TargetFramework>
1010
<AssemblyName>Platform.Data.Doublets.Json</AssemblyName>

0 commit comments

Comments
 (0)