Comments (4)
This should be easy to fix. You just need to return from function when the first datafile
call returns something. Would you like to send a PR?
from spaceship-prompt.
I actually think a better solution would be to read the pyproject.toml
file once. jq
can do this via the Alternative Operator.
jq -r '.project.version // .tool.poetry.version' < pyproject.toml`
It could be done using multiple arguments to spaceship::datafile
and creating the jq query via ".${(j| // .|)keys}"
. This would also have to be implemented for the python and ruby implementations, which shouldn't be too difficult.
Of course, the simpler solution would be to just check for null
.
local version=$(spaceship::datafile --toml "$pyproject_toml" "tool.poetry.version")
if [[ "$version" == "null" ]]; then
version=$(spaceship::datafile --toml "$pyproject_toml" "project.version")
fi
echo "$version"
from spaceship-prompt.
spaceship:datafile
relies not only on jq
, but on various other tools, like pure python, node, etc. I'd stick to the simpler solution.
Please, send a PR. Your solution looks good to me.
from spaceship-prompt.
🎉 This issue has been resolved in version 4.15.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from spaceship-prompt.
Related Issues (20)
- spaceship::precompile:zcompile:6: can't open file: /usr/local/lib/node_modules/spaceship-prompt/prompt_spaceship_setup HOT 2
- Spaceship v.4.13.4 shows closing curly bracket } at the beginning of the prompt HOT 2
- Not showing any icon, even git branch name is not showing HOT 7
- I have a problem displaying the icons. HOT 1
- spaceship CLI repeatedly adds sections HOT 1
- Git User HOT 8
- Async section never goes away HOT 2
- Repurpose Xcode and Swift sections to use native tools HOT 6
- Multiple errors printed before prompt
- configuration docs lead to the creation of a directory `~/.config/spaceship.zsh` HOT 2
- python section not working HOT 3
- Prompt truncated at start
- Command not found: spaceship.zsh
- Prompt in Warp: bash: _ _ bp_interactive_mode: command not found HOT 1
- "📦 unspecified" for Android project using gradle with kts and version catalog
- Duplicate Git Branch Icons
- The repository FAQ clearly show starship stance of standing with Ukraine... Where is there stance for Palestine ? HOT 1
- Parent directory completion blanks out
- SPACESHIP_KUBECTL_SHOW causes duplicate characters in prompt 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 spaceship-prompt.