coapp / coapp.powershell

ClrPlus Signing
52 stars 43 forks source link

Using environment variables in conditions should be possible #50

Open mbrgm opened 10 years ago

mbrgm commented 10 years ago

My files section looks like this (stripped down but still reproduces the problem):

files {
    [${DEBUG_CONFIG}, x86] {
    };
};

When I replace ${DEBUG_CONFIG} with Debug, which is also defined as a environment variable, i.e. echo $env:DEBUG_CONFIG gives me Debug, it works. But when using the statement for the environment variable as specified above, I get an error:

Write-NuGetPackage : Invalid characters in expression
In Zeile:1 Zeichen:1
+ Write-NuGetPackage .\toolkit_template.autopkg -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-NuGetPackage], ClrPlusException
+ FullyQualifiedErrorId : ClrPlus.Core.Exceptions.ClrPlusException,CoApp.Powershell.Commands.WriteNuGetPackage

Could this be a newline issue?

fearthecowboy commented 10 years ago

I'm looking into this today.

mbrgm commented 10 years ago

What's the current status @fearthecowboy?

fearthecowboy commented 10 years ago

Sorry about the delay; I got sick leading up to the xmas break. Looking at this again right now.

Oh, wow.

I thought I knew why this was happening, and I finally figured out what the problem is. Turns out it's in a totally different part of the code than I thought it was.

HMMMM.

thinking

fearthecowboy commented 10 years ago

Ok, I've got this fixed on my desktop, I'll publish this build this afternoon sometime.

forewarning, if the DEBUG_CONFIG environment variable isn't set, it'll still error out (since there isn't a macro replacement, it continues with the invalid chars in place)

G

fearthecowboy commented 10 years ago

Update to the latest development version (2.4.493.0) to test this--from an elevated powershell prompt:

> Update-CoAppTools -development -killpowershells

mbrgm commented 10 years ago

This issue seems to be resolved; however, there is still one issue: I'm now getting an error Write-NuGetPackage : Der Name "Needs-mypackage_${FOO}" enthält das ungültige Zeichen "$"., which means The name "Needs-mypackage_${FOO}" contains the invalid character "$". I specified my nuget.nuspec.id: mypackage_${FOO};. Could it be that the variable expansion is not done early enough in the process, so that some variables still sneak into a later stage?

mbrgm commented 10 years ago

@fearthecowboy: Did you have the chance to have a look at this?