Git Product home page Git Product logo

Comments (8)

colindembovsky avatar colindembovsky commented on June 12, 2024 1

Hi @reidsimon - argh! Seems like the task lib is putting quotes around the variables that you are passing in (perhaps because you have 2 variables in a string?). Anyway, I've added code to remove any quotes from the source path - can you try again please?

from cols-agent-tasks.

colindembovsky avatar colindembovsky commented on June 12, 2024

Are you including quote characters " in the path? You should not be doing so. Can you try it without the quotes?

from cols-agent-tasks.

reidsimon avatar reidsimon commented on June 12, 2024

I am not including quote characters. Just tested again with this input:

Source Path: $(System.DefaultWorkingDirectory)/$(Build.DefinitionName)/drop
Target File Pattern: WebApp.SetParameters.xml

and got this output:

2016-03-18T14:26:20.0520641Z Set workingFolder to default: C:\vsts_agent\agent\tasks\ReplaceTokens\0.0.5

2016-03-18T14:26:20.2551915Z ##[debug]Starting Replace Tokens step

2016-03-18T14:26:20.2551915Z ##[debug]sourcePath=C:\vsts_agent_work\874a330a4\Test build copy\drop

2016-03-18T14:26:20.2551915Z ##[debug]check path : C:\vsts_agent_work\874a330a4\Test build copy\drop

2016-03-18T14:26:20.2551915Z ##[debug]sourcePath="C:\vsts_agent_work\874a330a4\Test build copy\drop"

2016-03-18T14:26:20.2551915Z ##[debug]filePattern=WebApp.SetParameters.xml

2016-03-18T14:26:20.2551915Z ##[debug]tokenRegex=(\w+)

2016-03-18T14:26:20.2551915Z ##[debug]sourcePath :"C:\vsts_agent_work\874a330a4\Test build copy\drop"

2016-03-18T14:26:20.2551915Z ##[debug]filePattern : WebApp.SetParameters.xml

2016-03-18T14:26:20.2551915Z ##[debug]tokenRegex : (\w+)

2016-03-18T14:26:20.2551915Z ##[debug]Using WebApp.SetParameters.xml as filePattern

2016-03-18T14:26:20.2551915Z ##[debug]glob "C:\vsts_agent_work\874a330a4\Test build copy\drop"\WebApp.SetParameters.xml

2016-03-18T14:26:20.2551915Z ##[debug]found 0 matches

2016-03-18T14:26:20.2551915Z ##[error]Could not find files with pattern [WebApp.SetParameters.xml] in path ["C:\vsts_agent_work\874a330a4\Test build copy\drop"]

from cols-agent-tasks.

reidsimon avatar reidsimon commented on June 12, 2024

ReplaceTokens 0.0.10 removed the leading quote, but there is still a trailing quote:

Set workingFolder to default: C:\vsts_agent\agent\tasks\ReplaceTokens\0.0.10
...
##[debug]glob C:\vsts_agent_work\874a330a4\Test build copy\drop"\WebApp.SetParameters.xml

from cols-agent-tasks.

colindembovsky avatar colindembovsky commented on June 12, 2024

@reidsimon For some strange reason sourcePath = sourcePath.replace("\"", "") still left a trailing quote. I just do a replacement on the whole glob like this:
globPattern = ${sourcePath}\${filePattern}.replace("\"", "") which seems to do the trick!

Please confirm that this works for you and I'll close this issue. Thanks for working with me on this!

from cols-agent-tasks.

reidsimon avatar reidsimon commented on June 12, 2024

Still an issue in 0.0.12. .replace(/\"/g,"") on the globPattern seems to work better.

from cols-agent-tasks.

colindembovsky avatar colindembovsky commented on June 12, 2024

Shoot! I am sure this worked, but when I tried it again it still failed. Anyway, I've incorporated your regex replacement and I think it's fixed.

from cols-agent-tasks.

reidsimon avatar reidsimon commented on June 12, 2024

Works great now, thanks!

from cols-agent-tasks.

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.