Skip to content

Commit

Permalink
Merge pull request #21 from linksplatform/tools
Browse files Browse the repository at this point in the history
Change args order. Add auto merge. Update package.
  • Loading branch information
Konard committed Aug 13, 2021
2 parents a556b7d + 4355917 commit 131da60
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/AutoMerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: auto-merge

on:
pull_request_target:

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTO_MERGE_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ public class JsonExporterCli<TLink>
{
public void Run(params string[] args)
{
var linksFilePath = ConsoleHelpers.GetOrReadArgument(0, "Links file path", args);
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(1, "JSON file path", args);
var documentName = ConsoleHelpers.GetOrReadArgument(2, "Document name", args);
var argumentIndex = 0;
var linksFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "Links file path", args);
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "JSON file path", args);
var defaultDocumentName = Path.GetFileNameWithoutExtension(jsonFilePath);
var documentName = ConsoleHelpers.GetOrReadArgument(argumentIndex, $"Document name (default: {defaultDocumentName})", args);
if (string.IsNullOrWhiteSpace(documentName))
{
documentName = defaultDocumentName;
}
if (!File.Exists(linksFilePath))
{
Console.WriteLine($"${linksFilePath} file does not exist.");
Expand Down
12 changes: 9 additions & 3 deletions csharp/Platform.Data.Doublets.Json/JsonImporterCli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ public class JsonImporterCli<TLink>
{
public void Run(params string[] args)
{
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(0, "JSON file path", args);
var documentName = ConsoleHelpers.GetOrReadArgument(1, "Document name", args);
var linksFilePath = ConsoleHelpers.GetOrReadArgument(2, "Links file path", args);
var argumentIndex = 0;
var jsonFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "JSON file path", args);
var linksFilePath = ConsoleHelpers.GetOrReadArgument(argumentIndex++, "Links file path", args);
var defaultDocumentName = Path.GetFileNameWithoutExtension(jsonFilePath);
var documentName = ConsoleHelpers.GetOrReadArgument(argumentIndex, $"Document name (default: {defaultDocumentName})", args);
if (string.IsNullOrWhiteSpace(documentName))
{
documentName = defaultDocumentName;
}
if (!File.Exists(jsonFilePath))
{
Console.WriteLine($"${jsonFilePath} file does not exist.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>LinksPlatform's Platform.Data.Doublets.Json Class Library</Description>
<Copyright>FreePhoenix888</Copyright>
<AssemblyTitle>Platform.Data.Doublets.Json</AssemblyTitle>
<VersionPrefix>0.0.2</VersionPrefix>
<VersionPrefix>0.1.0</VersionPrefix>
<Authors>FreePhoenix888</Authors>
<TargetFramework>net5</TargetFramework>
<AssemblyName>Platform.Data.Doublets.Json</AssemblyName>
Expand Down

0 comments on commit 131da60

Please sign in to comment.