Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generator outfile parsing on CLI #321

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading