Coder Social home page Coder Social logo

Comments (4)

danielpalme avatar danielpalme commented on August 20, 2024

Hi Peter,

the problem is that CruiseControl replaces all links with it's custom URLs.
That works fine for static files. But if JavaScript is enabled, the summary report is rendered dynamically.
The URLs created in JavaScript are not rewritten and therefore don't work.

The download on my blog includes a file named tools/RemoveScriptsFromReport.ps1.
If you run this file after ReportGenerator the JavaScript is removed and you should be able to use the static report with working links.

This is the Powershell script:

param (
    [string]$file
 )

((Get-Content "$file") -join "`n").Replace("<script", "<!-- script").Replace("</script>", "</script -->") | Set-Content "$file"

This is really annoying, but I don't think that there is anything that ReportGenerator can do about.

I use TeamCity for CI, that works much better.
It's very easy to setup and to configure (much easier than CruiseControl) and it is free.

from reportgenerator.

qujck avatar qujck commented on August 20, 2024

I did try to get the script to work before raising the issue

I had to run Set-ExecutionPolicy RemoteSigned

Which got me to this

C:\CCNet\OpenCover>PowerShell RemoveScriptsFromReport.ps1 C:\CCNet\BuildArtifacts\x\65\coveragereport\index.htm
The term 'RemoveScriptsFromReport.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:28

  • RemoveScriptsFromReport.ps1 <<<< C:\CCNet\BuildArtifacts\x\65\coveragereport\index.html
    • CategoryInfo : ObjectNotFound: (RemoveScriptsFromReport.ps1:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

from reportgenerator.

danielpalme avatar danielpalme commented on August 20, 2024

You probably need to prefix the path to the script with "."
See http://stackoverflow.com/questions/762927/powershell-ps1-file-is-not-recognized-as-a-cmdlet-function-operable-program

from reportgenerator.

qujck avatar qujck commented on August 20, 2024

Yep, that fixed it. Thanks!

from reportgenerator.

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.