Git Product home page Git Product logo

Comments (7)

sayedihashimi avatar sayedihashimi commented on August 15, 2024

@Arithmomaniac thanks for the issue, I agree it should be fixed. I've marked it as Approved.

I think I know how to fix it. When calling msbuild.exe we should use a pattern like what I'm using at https://github.com/sayedihashimi/publish-module/blob/master/package-downloader.psm1#L46. Here is the function

function Execute-CommandString{
    [cmdletbinding()]
    param(
        [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
        [string[]]$command,

        [switch]
        $ignoreExitCode
    )
    process{
        foreach($cmdToExec in $command){
            'Executing command [{0}]' -f $cmdToExec | Write-Verbose
            cmd.exe /D /C $cmdToExec

            if(-not $ignoreExitCode -and ($LASTEXITCODE -ne 0)){
                $msg = ('The command [{0}] exited with code [{1}]' -f $cmdToExec, $LASTEXITCODE)
                throw $msg
            }
        }
    }
}

from psbuild.

sayedihashimi avatar sayedihashimi commented on August 15, 2024

OK turns out the fix was simpler than I thought. I've updated the module in the dev branch. Can you try it and re open if you still have issues?

from psbuild.

Arithmomaniac avatar Arithmomaniac commented on August 15, 2024

What if there's an apostrophe inside the string argument? With this method, you should have logic to escape that too.

from psbuild.

sayedihashimi avatar sayedihashimi commented on August 15, 2024

Thanks now that I'm thinking more here's your idea 💡 with some others.

  • Add quotes if not already quoted
  • Add a global setting which is true by default to enable
  • Add a parameter to Invoke-MSBuild

from psbuild.

sayedihashimi avatar sayedihashimi commented on August 15, 2024

Hi @Arithmomaniac I have made the changes outlined in the commit aacb74f. Could you review and let me know if this looks better? Will close for now.

from psbuild.

sayedihashimi avatar sayedihashimi commented on August 15, 2024

Looks like this broke some existing builds, see #54.
I've disabled it globally and released. You can enable with the global option EnablePropertyQuoting.

from psbuild.

sayedihashimi avatar sayedihashimi commented on August 15, 2024

Should be fixed after the updates

from psbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.