Comments (8)
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.
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.
I am not including quote characters. Just tested again with this input:
Source Path:
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.
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.
@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.
Still an issue in 0.0.12. .replace(/\"/g,"")
on the globPattern seems to work better.
from cols-agent-tasks.
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.
Works great now, thanks!
from cols-agent-tasks.
Related Issues (20)
- rejection id: 1 HOT 4
- Replace Tokens Feature Request: Allow task to work with zip files HOT 3
- An error occurred during deployment plan generation. Deployment cannot continue.
- Cannot see deploymentReport.md in Azure Devops Pipeline after comparison HOT 2
- Possibility to override DatabaseName from 'Test' in generated script
- TFS 2017.3 gives error when using the coverage gate
- Cannot read property 'join' of null
- How do you debug this in Visual studio code
- AZure Devops 2020 Self Signed Cert
- Cannot read property 'endsWith' of undefined HOT 1
- Tag Build or Release task should log an error if it can't tag
- Error When Perform Dacpac Schema Compare in YAML version of Azure Build pipeline
- Replace Tokens Node 6 to 10 Migration HOT 5
- Allow user to configure extension to fail if token replacement is suspect HOT 5
- Tag Build or Release 'A supported task execution handler was not found.' error on TFS 2018 HOT 8
- Example YML for tagging a build is not correct HOT 2
- ##[error]A supported task execution handler was not found. This error usually means the task does not carry an implementation that is compatible with your current operating system. Contact the task author for more details. HOT 3
- DacPacReport: Files in extension version 1.4.152 (task version 1.2.178) differ from latest version in main branch
- New task versions can not be used due to incorrect versioning
- Vulnerability Issue Found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cols-agent-tasks.