mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 17:15:34 +03:00
Look for special files in all parent directories
This commit is contained in:
parent
e3b79b7358
commit
7aababe7de
@ -1,3 +1,4 @@
|
||||
function _tide_item_crystal
|
||||
test -e shard.yml && _tide_print_item crystal $tide_crystal_icon' ' (crystal --version | string match -r "[\d.]+")[1]
|
||||
path is $_tide_parent_dirs/shard.yml &&
|
||||
_tide_print_item crystal $tide_crystal_icon' ' (crystal --version | string match -r "[\d.]+")[1]
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
function _tide_item_go
|
||||
test -e go.mod && _tide_print_item go $tide_go_icon' ' (go version | string match -r "[\d.]+")
|
||||
path is $_tide_parent_dirs/go.mod &&
|
||||
_tide_print_item go $tide_go_icon' ' (go version | string match -r "[\d.]+")
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
function _tide_item_java
|
||||
test -e pom.xml && _tide_print_item java $tide_java_icon' ' (java -version &| string match -r "[\d.]+")[1]
|
||||
path is $_tide_parent_dirs/pom.xml &&
|
||||
_tide_print_item java $tide_java_icon' ' (java -version &| string match -r "[\d.]+")[1]
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
function _tide_item_node
|
||||
test -e package.json && _tide_print_item node $tide_node_icon' ' (node --version | string trim --chars=v)
|
||||
path is $_tide_parent_dirs/package.json &&
|
||||
_tide_print_item node $tide_node_icon' ' (node --version | string trim --chars=v)
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
function _tide_item_php
|
||||
test -e composer.json && _tide_print_item php $tide_php_icon' ' (php --version | string match -r 'PHP ([\d.]+)')[2]
|
||||
path is $_tide_parent_dirs/composer.json &&
|
||||
_tide_print_item php $tide_php_icon' ' (php --version | string match -r 'PHP ([\d.]+)')[2]
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
function _tide_item_rustc
|
||||
test -e Cargo.toml && _tide_print_item rustc $tide_rustc_icon' ' (rustc --version | string split ' ')[2]
|
||||
path is $_tide_parent_dirs/Cargo.toml &&
|
||||
_tide_print_item rustc $tide_rustc_icon' ' (rustc --version | string split ' ')[2]
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
function _tide_item_terraform
|
||||
if test -d .terraform
|
||||
if path is $_tide_parent_dirs/.terraform
|
||||
terraform workspace show | read -l workspace
|
||||
test $workspace != default && _tide_print_item terraform $tide_terraform_icon' ' $workspace
|
||||
end
|
||||
|
6
functions/_tide_parent_dirs.fish
Normal file
6
functions/_tide_parent_dirs.fish
Normal file
@ -0,0 +1,6 @@
|
||||
function _tide_parent_dirs --on-variable PWD
|
||||
set -g _tide_parent_dirs (for dir in (string split / $PWD)
|
||||
set -la parts $dir
|
||||
string join / $parts
|
||||
end)
|
||||
end
|
@ -4,6 +4,7 @@ status is-interactive || exit
|
||||
|
||||
_tide_remove_unusable_items
|
||||
_tide_cache_variables
|
||||
_tide_parent_dirs
|
||||
source (functions --details _tide_pwd)
|
||||
|
||||
set -l prompt_var _tide_prompt_$fish_pid
|
||||
@ -38,6 +39,7 @@ function fish_prompt
|
||||
_tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint
|
||||
jobs -q && set -lx _tide_jobs
|
||||
$fish_path -c \"set _tide_pipestatus \$_tide_pipestatus
|
||||
set _tide_parent_dirs \$_tide_parent_dirs
|
||||
CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" &
|
||||
builtin disown
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user