From 3858228776a33899bcc2347335fc46e06ebf8ef3 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Mon, 12 Oct 2020 15:05:51 -0700 Subject: [PATCH] Switch to scuba --- .github/workflows/CI.yml | 9 +- CONTRIBUTING.md | 5 +- README.md | 5 +- conf.d/_tide_init.fish | 54 +++++++++- docs/Configuration.md | 2 +- functions/_tide_sub_test.fish | 7 +- .../tide}/configure/choices/all/finish.fish | 0 .../prompt_connection_andor_frame_color.fish | 0 .../configure/choices/all/prompt_spacing.fish | 0 .../tide}/configure/choices/all/style.fish | 0 .../choices/classic/classic_prompt_color.fish | 0 .../classic/classic_prompt_connection.fish | 0 .../choices/classic/classic_prompt_frame.fish | 0 .../choices/classic/classic_prompt_heads.fish | 0 .../classic/classic_prompt_height.fish | 0 .../classic/classic_prompt_separators.fish | 0 .../choices/classic/classic_prompt_tails.fish | 0 .../choices/classic/classic_show_time.fish | 0 .../choices/lean/lean_prompt_connection.fish | 0 .../choices/lean/lean_prompt_height.fish | 0 .../choices/lean/lean_show_time.fish | 0 .../pure/pure_nonperm_content_location.fish | 0 .../choices/pure/pure_prompt_height.fish | 0 .../choices/pure/pure_show_time.fish | 0 .../rainbow/rainbow_prompt_connection.fish | 0 .../choices/rainbow/rainbow_prompt_frame.fish | 0 .../choices/rainbow/rainbow_prompt_heads.fish | 0 .../rainbow/rainbow_prompt_height.fish | 0 .../rainbow/rainbow_prompt_separators.fish | 0 .../choices/rainbow/rainbow_prompt_tails.fish | 0 .../choices/rainbow/rainbow_show_time.fish | 0 .../tide}/configure/configs/classic.fish | 0 .../tide}/configure/configs/lean.fish | 0 .../tide}/configure/configs/pure.fish | 0 .../tide}/configure/configs/rainbow.fish | 0 .../tide}/configure/fish_prompt.fish | 0 .../configure/functions/fake_prompt.fish | 0 .../fake_tide_count_left_prompt_height.fish | 0 .../functions/fake_tide_left_prompt.fish | 0 .../functions/fake_tide_right_prompt.fish | 0 .../_fake_tide_item_cmd_duration.fish | 0 .../_fake_tide_item_git_prompt.fish | 0 .../_fake_tide_item_prompt_char.fish | 0 .../prompt_items/_fake_tide_item_pwd.fish | 0 .../prompt_items/_fake_tide_item_time.fish | 0 .../tide}/tests/CI/os.fish | 0 .../tide}/tests/CI/time.fish | 0 .../tide}/tests/cmd_duration.fish | 0 .../tide}/tests/context.fish | 0 .../tide}/tests/count_left_prompt_height.fish | 0 .../tide}/tests/cursor_right.fish | 0 .../tide}/tests/cursor_up.fish | 0 .../tide}/tests/decolor.fish | 0 .../tide}/tests/jobs.fish | 0 {tide_theme => functions/tide}/tests/pwd.fish | 0 .../tide}/tests/rust.fish | 0 .../tide}/tests/status.fish | 0 .../tide}/tests/virtual_env.fish | 0 tools/_tide_actual_install.fish | 102 ------------------ tools/tide_install.fish | 30 ------ 60 files changed, 64 insertions(+), 150 deletions(-) rename {tide_theme => functions/tide}/configure/choices/all/finish.fish (100%) rename {tide_theme => functions/tide}/configure/choices/all/prompt_connection_andor_frame_color.fish (100%) rename {tide_theme => functions/tide}/configure/choices/all/prompt_spacing.fish (100%) rename {tide_theme => functions/tide}/configure/choices/all/style.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_color.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_connection.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_frame.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_heads.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_height.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_separators.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_prompt_tails.fish (100%) rename {tide_theme => functions/tide}/configure/choices/classic/classic_show_time.fish (100%) rename {tide_theme => functions/tide}/configure/choices/lean/lean_prompt_connection.fish (100%) rename {tide_theme => functions/tide}/configure/choices/lean/lean_prompt_height.fish (100%) rename {tide_theme => functions/tide}/configure/choices/lean/lean_show_time.fish (100%) rename {tide_theme => functions/tide}/configure/choices/pure/pure_nonperm_content_location.fish (100%) rename {tide_theme => functions/tide}/configure/choices/pure/pure_prompt_height.fish (100%) rename {tide_theme => functions/tide}/configure/choices/pure/pure_show_time.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_connection.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_frame.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_heads.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_height.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_separators.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_prompt_tails.fish (100%) rename {tide_theme => functions/tide}/configure/choices/rainbow/rainbow_show_time.fish (100%) rename {tide_theme => functions/tide}/configure/configs/classic.fish (100%) rename {tide_theme => functions/tide}/configure/configs/lean.fish (100%) rename {tide_theme => functions/tide}/configure/configs/pure.fish (100%) rename {tide_theme => functions/tide}/configure/configs/rainbow.fish (100%) rename {tide_theme => functions/tide}/configure/fish_prompt.fish (100%) rename {tide_theme => functions/tide}/configure/functions/fake_prompt.fish (100%) rename {tide_theme => functions/tide}/configure/functions/fake_tide_count_left_prompt_height.fish (100%) rename {tide_theme => functions/tide}/configure/functions/fake_tide_left_prompt.fish (100%) rename {tide_theme => functions/tide}/configure/functions/fake_tide_right_prompt.fish (100%) rename {tide_theme => functions/tide}/configure/prompt_items/_fake_tide_item_cmd_duration.fish (100%) rename {tide_theme => functions/tide}/configure/prompt_items/_fake_tide_item_git_prompt.fish (100%) rename {tide_theme => functions/tide}/configure/prompt_items/_fake_tide_item_prompt_char.fish (100%) rename {tide_theme => functions/tide}/configure/prompt_items/_fake_tide_item_pwd.fish (100%) rename {tide_theme => functions/tide}/configure/prompt_items/_fake_tide_item_time.fish (100%) rename {tide_theme => functions/tide}/tests/CI/os.fish (100%) rename {tide_theme => functions/tide}/tests/CI/time.fish (100%) rename {tide_theme => functions/tide}/tests/cmd_duration.fish (100%) rename {tide_theme => functions/tide}/tests/context.fish (100%) rename {tide_theme => functions/tide}/tests/count_left_prompt_height.fish (100%) rename {tide_theme => functions/tide}/tests/cursor_right.fish (100%) rename {tide_theme => functions/tide}/tests/cursor_up.fish (100%) rename {tide_theme => functions/tide}/tests/decolor.fish (100%) rename {tide_theme => functions/tide}/tests/jobs.fish (100%) rename {tide_theme => functions/tide}/tests/pwd.fish (100%) rename {tide_theme => functions/tide}/tests/rust.fish (100%) rename {tide_theme => functions/tide}/tests/status.fish (100%) rename {tide_theme => functions/tide}/tests/virtual_env.fish (100%) delete mode 100644 tools/_tide_actual_install.fish delete mode 100644 tools/tide_install.fish diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ad8490f..df0a221 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,10 +22,11 @@ jobs: - uses: fish-actions/install-fish@v1 - - name: Install Tide unattended - run: | - source $GITHUB_WORKSPACE/tools/tide_install.fish - tide_install --local --unattended $GITHUB_WORKSPACE + - name: Install Scuba + run: curl -sL git.io/scuba-install | source && _scuba_sub_install ilancosman/scuba + + - name: Install Tide + run: scuba install $GITHUB_WORKSPACE - name: Install testing dependencies run: tide test --install diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8179a60..f60b83a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,6 @@ Anything exposed to the shell or user--functions, global/universal variables, an - `set -U tide_right_prompt_items` - `_tide_count_left_prompt_height.fish` - `_tide_right_prompt` -- `tide_install` #### Specific Naming Conventions @@ -41,7 +40,7 @@ Anything exposed to the shell or user--functions, global/universal variables, an ### Dependencies -- [fisher][] - plugin manager for fish +- [scuba][] - plugin manager for fish - [spout][] - 100% pure-fish TAP-based test runner - [clownfish][] - override the behavior of commands @@ -93,10 +92,10 @@ Todo on release: [`fish_indent`]: https://fishshell.com/docs/current/cmds/fish_indent.html [clownfish]: https://github.com/IlanCosman/clownfish [code of conduct]: CODE_OF_CONDUCT.md -[fisher]: https://github.com/jorgebucaran/fisher [markdownlint]: https://github.com/DavidAnson/markdownlint [prettier]: https://github.com/prettier/prettier [reference style]: https://www.markdownguide.org/basic-syntax/#reference-style-links +[scuba]: https://github.com/IlanCosman/scuba [spout]: https://github.com/IlanCosman/spout [super-linter]: https://github.com/github/super-linter [yamllint]: https://github.com/adrienverge/yamllint diff --git a/README.md b/README.md index beb48c8..0689fbb 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ - [Fish][] ≥ 3.1 - A [Nerd Font][nerd fonts] installed and enabled in your terminal (for example the [recommended font](#fonts)). -#### Source and run the install function +#### Install with [Scuba][] ```console -curl -sL git.io/tide | source && tide_install +scuba install IlanCosman/tide ``` ## Features @@ -159,5 +159,6 @@ Open each file and click "Install". This will make the `MesloLGS NF` font availa [nerd fonts]: https://github.com/ryanoasis/nerd-fonts [powerlevel10k]: https://github.com/romkatv/powerlevel10k/ [pure]: https://github.com/rafaelrinaldi/pure +[scuba]: https://github.com/IlanCosman/scuba [spacefish]: https://github.com/matchai/spacefish [starship]: https://github.com/starship/starship diff --git a/conf.d/_tide_init.fish b/conf.d/_tide_init.fish index a6b2523..7a84d32 100644 --- a/conf.d/_tide_init.fish +++ b/conf.d/_tide_init.fish @@ -1,7 +1,53 @@ -_tide_count_left_prompt_height +if set -q _tide_version + _tide_count_left_prompt_height -_tide_detect_os + _tide_detect_os -_tide_git_prompt_set_vars + _tide_git_prompt_set_vars -_tide_pwd \ No newline at end of file + _tide_pwd +end + +function _tide_init_install --on-event _tide_init_install + _set_immutable _tide_color_dark_blue 0087AF + _set_immutable _tide_color_dark_green 5FAF00 + _set_immutable _tide_color_gold D7AF00 + _set_immutable _tide_color_green 5FD700 + _set_immutable _tide_color_light_blue 00AFFF + _set_immutable _tide_color_normal (set_color normal) + + _set_immutable _tide_dir "$__fish_config_dir/functions/tide" + _set_immutable _tide_version 2.4.0 + + _set_immutable NVM_DIR $HOME/.nvm + _set_immutable VIRTUAL_ENV_DISABLE_PROMPT true + + set -U _tide_var_list + + source "$_tide_dir/configure/choices/all/style.fish" + _load_config 'lean' + + source "$_tide_dir/configure/choices/all/finish.fish" + _tide_finish + + source "$__fish_config_dir/functions/fish_prompt.fish" + + if status is-interactive + while true + switch (read --prompt-str="Configure tide prompt? [Y/n] ") + case y Y yes Yes '' + tide configure + case n N no No + printf '%s' \ + \n 'Run ' (set_color $fish_color_command) 'tide ' \ + (set_color $fish_color_param) 'configure ' (set_color normal) 'to customize your prompt.' \n + end + break + end + end +end + +function _set_immutable -a var_name + set -U $var_name $argv[2..-1] + set -Ua _tide_var_immutable_list $var_name +end \ No newline at end of file diff --git a/docs/Configuration.md b/docs/Configuration.md index 358e13c..0b033ef 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -12,7 +12,7 @@ The following sections contain tables of variable names, their descriptions, and Variables in these sections will be denoted as `foo_bar` but will actually be `tide__foo_bar`. Variables that do not conform to this standard will be written out in full. -You can take a look at the default configurations in `~/.config/fish/tide_theme/configure/configs` for inspiration. +You can take a look at the default configurations in `~/.config/fish/functions/tide/configure/configs` for inspiration. You can modify variables using `set --universal` from the command line or `set --global` in your `config.fish` file. diff --git a/functions/_tide_sub_test.fish b/functions/_tide_sub_test.fish index f5461eb..4a999ac 100644 --- a/functions/_tide_sub_test.fish +++ b/functions/_tide_sub_test.fish @@ -5,9 +5,8 @@ function _tide_sub_test _tide_test_help return 0 else if set -q _flag_install - # Install fisher and spout for testing - curl git.io/fisher --create-dirs -sLo $__fish_config_dir/functions/fisher.fish - fisher add IlanCosman/spout IlanCosman/clownfish + # Install scuba, spout, and clownfish for testing + curl -sL git.io/scuba-install | source && _scuba_sub_install ilancosman/scuba IlanCosman/spout IlanCosman/clownfish return 0 end @@ -84,7 +83,7 @@ function _tide_test_help 'display test output even if passed' \ 'run all available tests' \ 'print this help message' \ - 'install fisher and spout test dependencies' \ + 'install testing dependencies' \ 'run tests designed for CI' printf '%s\n' 'Usage: '$bl'tide test '$n'[options] '$b'[TESTS...]'$n diff --git a/tide_theme/configure/choices/all/finish.fish b/functions/tide/configure/choices/all/finish.fish similarity index 100% rename from tide_theme/configure/choices/all/finish.fish rename to functions/tide/configure/choices/all/finish.fish diff --git a/tide_theme/configure/choices/all/prompt_connection_andor_frame_color.fish b/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish similarity index 100% rename from tide_theme/configure/choices/all/prompt_connection_andor_frame_color.fish rename to functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish diff --git a/tide_theme/configure/choices/all/prompt_spacing.fish b/functions/tide/configure/choices/all/prompt_spacing.fish similarity index 100% rename from tide_theme/configure/choices/all/prompt_spacing.fish rename to functions/tide/configure/choices/all/prompt_spacing.fish diff --git a/tide_theme/configure/choices/all/style.fish b/functions/tide/configure/choices/all/style.fish similarity index 100% rename from tide_theme/configure/choices/all/style.fish rename to functions/tide/configure/choices/all/style.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_color.fish b/functions/tide/configure/choices/classic/classic_prompt_color.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_color.fish rename to functions/tide/configure/choices/classic/classic_prompt_color.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_connection.fish b/functions/tide/configure/choices/classic/classic_prompt_connection.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_connection.fish rename to functions/tide/configure/choices/classic/classic_prompt_connection.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_frame.fish b/functions/tide/configure/choices/classic/classic_prompt_frame.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_frame.fish rename to functions/tide/configure/choices/classic/classic_prompt_frame.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_heads.fish b/functions/tide/configure/choices/classic/classic_prompt_heads.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_heads.fish rename to functions/tide/configure/choices/classic/classic_prompt_heads.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_height.fish b/functions/tide/configure/choices/classic/classic_prompt_height.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_height.fish rename to functions/tide/configure/choices/classic/classic_prompt_height.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_separators.fish b/functions/tide/configure/choices/classic/classic_prompt_separators.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_separators.fish rename to functions/tide/configure/choices/classic/classic_prompt_separators.fish diff --git a/tide_theme/configure/choices/classic/classic_prompt_tails.fish b/functions/tide/configure/choices/classic/classic_prompt_tails.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_prompt_tails.fish rename to functions/tide/configure/choices/classic/classic_prompt_tails.fish diff --git a/tide_theme/configure/choices/classic/classic_show_time.fish b/functions/tide/configure/choices/classic/classic_show_time.fish similarity index 100% rename from tide_theme/configure/choices/classic/classic_show_time.fish rename to functions/tide/configure/choices/classic/classic_show_time.fish diff --git a/tide_theme/configure/choices/lean/lean_prompt_connection.fish b/functions/tide/configure/choices/lean/lean_prompt_connection.fish similarity index 100% rename from tide_theme/configure/choices/lean/lean_prompt_connection.fish rename to functions/tide/configure/choices/lean/lean_prompt_connection.fish diff --git a/tide_theme/configure/choices/lean/lean_prompt_height.fish b/functions/tide/configure/choices/lean/lean_prompt_height.fish similarity index 100% rename from tide_theme/configure/choices/lean/lean_prompt_height.fish rename to functions/tide/configure/choices/lean/lean_prompt_height.fish diff --git a/tide_theme/configure/choices/lean/lean_show_time.fish b/functions/tide/configure/choices/lean/lean_show_time.fish similarity index 100% rename from tide_theme/configure/choices/lean/lean_show_time.fish rename to functions/tide/configure/choices/lean/lean_show_time.fish diff --git a/tide_theme/configure/choices/pure/pure_nonperm_content_location.fish b/functions/tide/configure/choices/pure/pure_nonperm_content_location.fish similarity index 100% rename from tide_theme/configure/choices/pure/pure_nonperm_content_location.fish rename to functions/tide/configure/choices/pure/pure_nonperm_content_location.fish diff --git a/tide_theme/configure/choices/pure/pure_prompt_height.fish b/functions/tide/configure/choices/pure/pure_prompt_height.fish similarity index 100% rename from tide_theme/configure/choices/pure/pure_prompt_height.fish rename to functions/tide/configure/choices/pure/pure_prompt_height.fish diff --git a/tide_theme/configure/choices/pure/pure_show_time.fish b/functions/tide/configure/choices/pure/pure_show_time.fish similarity index 100% rename from tide_theme/configure/choices/pure/pure_show_time.fish rename to functions/tide/configure/choices/pure/pure_show_time.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_connection.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_connection.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_connection.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_connection.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_frame.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_frame.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_frame.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_frame.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_heads.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_heads.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_heads.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_heads.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_height.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_height.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_height.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_height.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_separators.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_separators.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_prompt_tails.fish b/functions/tide/configure/choices/rainbow/rainbow_prompt_tails.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_prompt_tails.fish rename to functions/tide/configure/choices/rainbow/rainbow_prompt_tails.fish diff --git a/tide_theme/configure/choices/rainbow/rainbow_show_time.fish b/functions/tide/configure/choices/rainbow/rainbow_show_time.fish similarity index 100% rename from tide_theme/configure/choices/rainbow/rainbow_show_time.fish rename to functions/tide/configure/choices/rainbow/rainbow_show_time.fish diff --git a/tide_theme/configure/configs/classic.fish b/functions/tide/configure/configs/classic.fish similarity index 100% rename from tide_theme/configure/configs/classic.fish rename to functions/tide/configure/configs/classic.fish diff --git a/tide_theme/configure/configs/lean.fish b/functions/tide/configure/configs/lean.fish similarity index 100% rename from tide_theme/configure/configs/lean.fish rename to functions/tide/configure/configs/lean.fish diff --git a/tide_theme/configure/configs/pure.fish b/functions/tide/configure/configs/pure.fish similarity index 100% rename from tide_theme/configure/configs/pure.fish rename to functions/tide/configure/configs/pure.fish diff --git a/tide_theme/configure/configs/rainbow.fish b/functions/tide/configure/configs/rainbow.fish similarity index 100% rename from tide_theme/configure/configs/rainbow.fish rename to functions/tide/configure/configs/rainbow.fish diff --git a/tide_theme/configure/fish_prompt.fish b/functions/tide/configure/fish_prompt.fish similarity index 100% rename from tide_theme/configure/fish_prompt.fish rename to functions/tide/configure/fish_prompt.fish diff --git a/tide_theme/configure/functions/fake_prompt.fish b/functions/tide/configure/functions/fake_prompt.fish similarity index 100% rename from tide_theme/configure/functions/fake_prompt.fish rename to functions/tide/configure/functions/fake_prompt.fish diff --git a/tide_theme/configure/functions/fake_tide_count_left_prompt_height.fish b/functions/tide/configure/functions/fake_tide_count_left_prompt_height.fish similarity index 100% rename from tide_theme/configure/functions/fake_tide_count_left_prompt_height.fish rename to functions/tide/configure/functions/fake_tide_count_left_prompt_height.fish diff --git a/tide_theme/configure/functions/fake_tide_left_prompt.fish b/functions/tide/configure/functions/fake_tide_left_prompt.fish similarity index 100% rename from tide_theme/configure/functions/fake_tide_left_prompt.fish rename to functions/tide/configure/functions/fake_tide_left_prompt.fish diff --git a/tide_theme/configure/functions/fake_tide_right_prompt.fish b/functions/tide/configure/functions/fake_tide_right_prompt.fish similarity index 100% rename from tide_theme/configure/functions/fake_tide_right_prompt.fish rename to functions/tide/configure/functions/fake_tide_right_prompt.fish diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_cmd_duration.fish b/functions/tide/configure/prompt_items/_fake_tide_item_cmd_duration.fish similarity index 100% rename from tide_theme/configure/prompt_items/_fake_tide_item_cmd_duration.fish rename to functions/tide/configure/prompt_items/_fake_tide_item_cmd_duration.fish diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_git_prompt.fish b/functions/tide/configure/prompt_items/_fake_tide_item_git_prompt.fish similarity index 100% rename from tide_theme/configure/prompt_items/_fake_tide_item_git_prompt.fish rename to functions/tide/configure/prompt_items/_fake_tide_item_git_prompt.fish diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_prompt_char.fish b/functions/tide/configure/prompt_items/_fake_tide_item_prompt_char.fish similarity index 100% rename from tide_theme/configure/prompt_items/_fake_tide_item_prompt_char.fish rename to functions/tide/configure/prompt_items/_fake_tide_item_prompt_char.fish diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_pwd.fish b/functions/tide/configure/prompt_items/_fake_tide_item_pwd.fish similarity index 100% rename from tide_theme/configure/prompt_items/_fake_tide_item_pwd.fish rename to functions/tide/configure/prompt_items/_fake_tide_item_pwd.fish diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_time.fish b/functions/tide/configure/prompt_items/_fake_tide_item_time.fish similarity index 100% rename from tide_theme/configure/prompt_items/_fake_tide_item_time.fish rename to functions/tide/configure/prompt_items/_fake_tide_item_time.fish diff --git a/tide_theme/tests/CI/os.fish b/functions/tide/tests/CI/os.fish similarity index 100% rename from tide_theme/tests/CI/os.fish rename to functions/tide/tests/CI/os.fish diff --git a/tide_theme/tests/CI/time.fish b/functions/tide/tests/CI/time.fish similarity index 100% rename from tide_theme/tests/CI/time.fish rename to functions/tide/tests/CI/time.fish diff --git a/tide_theme/tests/cmd_duration.fish b/functions/tide/tests/cmd_duration.fish similarity index 100% rename from tide_theme/tests/cmd_duration.fish rename to functions/tide/tests/cmd_duration.fish diff --git a/tide_theme/tests/context.fish b/functions/tide/tests/context.fish similarity index 100% rename from tide_theme/tests/context.fish rename to functions/tide/tests/context.fish diff --git a/tide_theme/tests/count_left_prompt_height.fish b/functions/tide/tests/count_left_prompt_height.fish similarity index 100% rename from tide_theme/tests/count_left_prompt_height.fish rename to functions/tide/tests/count_left_prompt_height.fish diff --git a/tide_theme/tests/cursor_right.fish b/functions/tide/tests/cursor_right.fish similarity index 100% rename from tide_theme/tests/cursor_right.fish rename to functions/tide/tests/cursor_right.fish diff --git a/tide_theme/tests/cursor_up.fish b/functions/tide/tests/cursor_up.fish similarity index 100% rename from tide_theme/tests/cursor_up.fish rename to functions/tide/tests/cursor_up.fish diff --git a/tide_theme/tests/decolor.fish b/functions/tide/tests/decolor.fish similarity index 100% rename from tide_theme/tests/decolor.fish rename to functions/tide/tests/decolor.fish diff --git a/tide_theme/tests/jobs.fish b/functions/tide/tests/jobs.fish similarity index 100% rename from tide_theme/tests/jobs.fish rename to functions/tide/tests/jobs.fish diff --git a/tide_theme/tests/pwd.fish b/functions/tide/tests/pwd.fish similarity index 100% rename from tide_theme/tests/pwd.fish rename to functions/tide/tests/pwd.fish diff --git a/tide_theme/tests/rust.fish b/functions/tide/tests/rust.fish similarity index 100% rename from tide_theme/tests/rust.fish rename to functions/tide/tests/rust.fish diff --git a/tide_theme/tests/status.fish b/functions/tide/tests/status.fish similarity index 100% rename from tide_theme/tests/status.fish rename to functions/tide/tests/status.fish diff --git a/tide_theme/tests/virtual_env.fish b/functions/tide/tests/virtual_env.fish similarity index 100% rename from tide_theme/tests/virtual_env.fish rename to functions/tide/tests/virtual_env.fish diff --git a/tools/_tide_actual_install.fish b/tools/_tide_actual_install.fish deleted file mode 100644 index 943494b..0000000 --- a/tools/_tide_actual_install.fish +++ /dev/null @@ -1,102 +0,0 @@ -function _tide_actual_install - argparse 'l/local' 'u/unattended' -- $argv - - set -l location $argv[1] - if test -z "$location" - set location 'main' - end - - set -gx TERM xterm # Necessary for testing purposes, ensures color codes are printed - - printf '%s\n' 'Installing tide theme...' - - # -----------------Download Files----------------- - set -lx tempDir '/tmp/tide_theme' - if test -e $tempDir - rm -rf $tempDir - end - - # Copy/clone repository into $tempDir - if set -q _flag_local - cp -rf "$location" "$tempDir" - else - git clone --quiet --depth 1 --branch $location https://github.com/IlanCosman/tide.git $tempDir - end - - for dir in completions conf.d functions tide_theme - cp -r "$tempDir/$dir" $__fish_config_dir - end - - # --------------------Set Defaults-------------------- - _set_immutables - - set -U _tide_var_list - - source "$_tide_dir/configure/choices/all/style.fish" - _load_config 'lean' - - source "$_tide_dir/configure/choices/all/finish.fish" - _tide_finish - - # -----------------------Finish----------------------- - for file in $_tide_file_list - source "$__fish_config_dir/$file" - end - source "$__fish_config_dir/functions/fish_prompt.fish" - - set_color $_tide_color_green - printf '%s\n' 'Tide theme installed!' - set_color normal - printf '%s\n' - - if not set -q _flag_unattended - if _user_confirm_defaultYes 'Configure tide prompt?' - tide configure - else - printf '%s\n' - printf '%s\n' 'Run tide configure to customize your prompt.' - end - end - - rm -rf $tempDir -end - -function _set_immutables - set -U _tide_var_immutable_list - - _set_immutable _tide_color_dark_blue 0087AF - _set_immutable _tide_color_dark_green 5FAF00 - _set_immutable _tide_color_gold D7AF00 - _set_immutable _tide_color_green 5FD700 - _set_immutable _tide_color_light_blue 00AFFF - _set_immutable _tide_color_normal (set_color normal) - - _set_immutable _tide_dir "$__fish_config_dir/tide_theme" - - _set_immutable _tide_file_list (string replace "$tempDir/" '' $tempDir/{completions/*, conf.d/*, functions/*}) - - _set_immutable _tide_version 2.4.0 - - _set_immutable NVM_DIR $HOME/.nvm - _set_immutable VIRTUAL_ENV_DISABLE_PROMPT true -end - -function _set_immutable -a var_name - set -U $var_name $argv[2..-1] - set -a _tide_var_immutable_list $var_name -end - -function _user_confirm_defaultYes -a question - while true - read -P "$question [Y/n] " input - - switch $input - case y Y yes Yes - return 0 - case n N no No - return 1 - case '' - return 0 - end - end -end \ No newline at end of file diff --git a/tools/tide_install.fish b/tools/tide_install.fish deleted file mode 100644 index 7baa0d6..0000000 --- a/tools/tide_install.fish +++ /dev/null @@ -1,30 +0,0 @@ -function tide_install - if not command -q git - printf '%s\n' 'Git must be available to install Tide.' - return 1 - end - - set -l options l/local u/unattended - argparse $options -- $argv - - # Pass through options to _tide_actual_install - for option in $options - set -l longFormOption (string split '/' $option)[2] - if set -q _flag_$longFormOption - set -a flags "--$longFormOption" - end - end - - set -l location $argv[-1] - if test -z "$location" - set location 'main' - end - - if set -q _flag_local - source "$location/tools/_tide_actual_install.fish" - else - curl --silent "https://raw.githubusercontent.com/IlanCosman/tide/$location/tools/_tide_actual_install.fish" | source - end - - _tide_actual_install $flags $argv -end \ No newline at end of file