Comments (2)
@rhtenhove This is pretty convoluted but does what you need. I do want to include some functionality to simplify this a lot.
orDefault(plugins.all().filter(equal(type(),array)).all().filter(equal(type(),object)).assets?.all().filter(equal(.,README.md)).count(),0).moreThan(.,0)
Essentially filter out any non README.md
items, count the items and then check if that's more than 0.
I'm wrapping the README.md
discovery in a call to orDefault
to get around the fact that it may return no rows if no array/object/README items are found.
from dasel.
I am looking for the same, however I can't get it to work even with the verbose example in this file:
{
"plugins": [
[
"@semantic-release/git",
{
"assets": ["README.md", "here/is/some-other-file.yml"],
}
],
"@semantic-release/gitlab"
]
}
I would expect the following to return README.md
dasel -f .releaserc -r json '.plugins.all().filter(equal(type(),array)).[1].as
sets.all().filter(equal(.,"README.md"))'
But it returns nothing.
The goal is to figure out if in this case README.md
is in that list or not.
from dasel.
Related Issues (20)
- Delete selector can't find keys with null values HOT 2
- Special characters inside string literals are replaced with Unicode escape sequences in JSON HOT 3
- -w xml is not working when -r is not xml HOT 3
- Support multiple files HOT 1
- CSV file format: Support other characters as separator HOT 2
- Output formatting is not right in some arrays HOT 6
- [BUG] Dasel crash when reading an empty file HOT 5
- Suppress header generation HOT 1
- Is it possible to get a raw value, i.e. without quotes? HOT 3
- Preserve order of keys in JSON lists HOT 1
- How to iterate? HOT 2
- Something is wrong with the new update using the Windows binaries HOT 5
- Crash on Windows 7 x64 HOT 4
- Dasel query crashes with go panic HOT 8
- Supported toml version? HOT 1
- Null value causes incorrect error "property not found" HOT 1
- Empty string becoming null when modifying YAML HOT 4
- Windows installation instructions do not work HOT 1
- Compile builds with tinygo for reasonable system file sizes HOT 1
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 dasel.