Skip to content

Commit

Permalink
Merge pull request #321 from betwixt-labs/dotnet-tools-fix
Browse files Browse the repository at this point in the history
fix: generator outfile parsing on CLI
  • Loading branch information
andrewmd5 committed Mar 18, 2024
2 parents 837ec19 + 1dc3d9e commit 226423a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .env
@@ -1,4 +1,4 @@
VERSION="3.0.4"
VERSION="3.0.5"
MAJOR=3
MINOR=0
PATCH=4
PATCH=5
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Expand Up @@ -248,6 +248,16 @@ jobs:
- name: Download Compiler Artifacts
uses: actions/download-artifact@v2

- name: List Chordc Artifacts
continue-on-error: true
run: |
ls ./chordc-osx-x64
ls ./chordc-osx-arm64
ls ./chordc-linux-x64
ls ./chordc-linux-arm64
ls ./chordc-win-x64
ls ./chordc-win-arm64
- name: Extract Compiler Artifacts
run: |
mkdir -p ${{github.workspace}}/bin/compiler/Debug/artifacts
Expand Down Expand Up @@ -586,6 +596,7 @@ jobs:


- name: Upload chordc for Windows x64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -596,6 +607,7 @@ jobs:
asset_content_type: application/zip

- name: Upload chordc for Windows ARM64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -606,6 +618,7 @@ jobs:
asset_content_type: application/zip

- name: Upload chordc for Mac x64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -616,6 +629,7 @@ jobs:
asset_content_type: application/zip

- name: Upload chordc for Mac ARM64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -626,6 +640,7 @@ jobs:
asset_content_type: application/zip

- name: Upload chordc for Linux x64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -636,6 +651,7 @@ jobs:
asset_content_type: application/zip

- name: Upload chordc for Linux ARM64
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion Compiler/Options/GeneratorOption.cs
Expand Up @@ -37,7 +37,7 @@ public GeneratorOption() : base(name: CliStrings.GeneratorFlag, ["-g"])
/// <returns>A <see cref="GeneratorConfig"/> object if the token could be parsed; otherwise, null.</returns>
private static GeneratorConfig? ParseGeneratorToken(string token, ArgumentResult result)
{
var parts = token.Split(':');
var parts = token.Split(':', 2);
if (parts.Length != 2)
{
result.AddError($"Incomplete generator token specified '{token}'.");
Expand All @@ -47,6 +47,11 @@ public GeneratorOption() : base(name: CliStrings.GeneratorFlag, ["-g"])
var generatorAlias = parts[0].Trim().ToLower();
var remaining = parts[1].Split(',');
var outputPath = remaining[0] ?? string.Empty;
if (string.IsNullOrWhiteSpace(outputPath))
{
result.AddError($"Output path not specified for generator '{generatorAlias}'.");
return null;
}


// If the output path is 'stdout', no need to validate it as a file path
Expand Down

0 comments on commit 226423a

Please sign in to comment.