spaceship-prompt 4.1.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [4.2.2](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.2.1...v4.2.2) (2022-09-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **julia:** Better detection for Julia projects ([b91ae3d](https://github.com/spaceship-prompt/spaceship-prompt/commit/b91ae3d0e5006260445c8a62706a3d79f453660d)), closes [#678](https://github.com/spaceship-prompt/spaceship-prompt/issues/678)
7
+
8
+ ## [4.2.1](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.2.0...v4.2.1) (2022-09-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * change the declaration of readonly variable to typeset ([f80bc28](https://github.com/spaceship-prompt/spaceship-prompt/commit/f80bc2813977f183d8c39ac1694bc1675d808589)), closes [#1175](https://github.com/spaceship-prompt/spaceship-prompt/issues/1175)
14
+
15
+ # [4.2.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.1.0...v4.2.0) (2022-09-02)
16
+
17
+
18
+ ### Features
19
+
20
+ * Add ruby interpreter in datafile util ([005f9fa](https://github.com/spaceship-prompt/spaceship-prompt/commit/005f9fa6191dc94d29cb6db3bd860b6b05b59ef9))
21
+
1
22
  # [4.1.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.0.0...v4.1.0) (2022-09-02)
2
23
 
3
24
 
package/lib/utils.zsh CHANGED
@@ -188,6 +188,8 @@ spaceship::datafile() {
188
188
  if [[ -n "$yaml" ]]; then
189
189
  if spaceship::exists yq; then
190
190
  yq -r ".$key" "$file"
191
+ elif spaceship::exists ruby; then
192
+ ruby -r yaml -e "puts '$key'.split('.').reduce(YAML::load_file('$file')) { |obj, key| obj[key] }" 2>/dev/null
191
193
  elif spaceship::exists python3; then
192
194
  python3 -c "import yaml, functools; print(functools.reduce(lambda obj, key: obj[key] if key else obj, '$key'.split('.'), yaml.safe_load(open('$file'))))" 2>/dev/null
193
195
  else
@@ -200,6 +202,8 @@ spaceship::datafile() {
200
202
  jq -r ".$key" "$file" 2>/dev/null
201
203
  elif spaceship::exists yq; then
202
204
  yq -r ".$key" "$file" 2>/dev/null
205
+ elif spaceship::exists ruby; then
206
+ ruby -r json -e "puts '$key'.split('.').reduce(JSON::load(File.read('$file'))){ |obj, key| obj[key] }" 2>/dev/null
203
207
  elif spaceship::exists python3; then
204
208
  python3 -c "import json, functools; print(functools.reduce(lambda obj, key: obj[key] if key else obj, '$key'.split('.'), json.load(open('$file'))))" 2>/dev/null
205
209
  elif spaceship::exists node; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spaceship-prompt",
3
- "version": "4.1.0",
3
+ "version": "4.2.2",
4
4
  "description": "A Zsh prompt for Astronauts.",
5
5
  "files": [
6
6
  "lib",
@@ -24,7 +24,8 @@ spaceship_julia() {
24
24
  [[ $SPACESHIP_JULIA_SHOW == false ]] && return
25
25
 
26
26
  # If there are julia files in current directory
27
- [[ -n *.jl(#qN^/) ]] || return
27
+ local is_julia_project="$(spaceship::upsearch Project.toml JuliaProject.toml Manifest.toml)"
28
+ [[ -n "$is_julia_project" || -n *.jl(#qN^/) ]] || return
28
29
 
29
30
  spaceship::exists julia || return
30
31
 
package/spaceship.zsh CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  # Current version of Spaceship
9
9
  # Useful for issue reporting
10
- export SPACESHIP_VERSION='4.1.0'
10
+ export SPACESHIP_VERSION='4.2.2'
11
11
 
12
12
  # Determination of Spaceship working directory
13
13
  # https://git.io/vdBH7
@@ -97,7 +97,7 @@ SPACESHIP_PROMPT_DEFAULT_SUFFIX="${SPACESHIP_PROMPT_DEFAULT_SUFFIX=" "}"
97
97
  # Spaceship utils/hooks/etc
98
98
  # ------------------------------------------------------------------------------
99
99
 
100
- readonly SPACESHIP_LIBS=(
100
+ typeset -r SPACESHIP_LIBS=(
101
101
  "lib/utils.zsh" # General porpuse utils
102
102
  "lib/cache.zsh" # Cache utils
103
103
  "lib/hooks.zsh" # Zsh hooks