diff --git a/README.md b/README.md index a103fef..82fa1ad 100644 --- a/README.md +++ b/README.md @@ -96,13 +96,15 @@ Sessions run with `Jido.Shell.Backend.Local` by default. The Bash backend hands entire command lines to a persistent `Bash.Session` process, so loops, conditionals, variables, pipes, and arithmetic expansion all work as in real Bash. State persists across calls within the same session. -**Dependency** — add the optional `:bash` package to your `mix.exs`: +The Bash backend currently depends on upstream `tv-labs/bash` changes that are +newer than the latest Hex release. Until those changes are published, the Bash +backend is available from source/Git builds and is excluded from the Hex +package. ```elixir {:bash, git: "https://github.com/tv-labs/bash.git", - ref: "c1038ff83e825c29ea131bf8b728bd1672734c01", - optional: true} + ref: "c1038ff83e825c29ea131bf8b728bd1672734c01"} ``` **Starting a session:** diff --git a/lib/jido_shell/backend/bash.ex b/lib/jido_shell/backend/bash.ex index 4dc2c39..af9b884 100644 --- a/lib/jido_shell/backend/bash.ex +++ b/lib/jido_shell/backend/bash.ex @@ -62,7 +62,8 @@ defmodule Jido.Shell.Backend.Bash do Jido.Shell.ShellSession.run_command(sid, "for i in 1 2 3; do echo $i; done") - Requires the optional `:bash` dependency to be compiled into the release. + Requires the compatible upstream `:bash` Git dependency until the next + `tv-labs/bash` Hex release includes `Bash.Session.signal/3`. """ @behaviour Jido.Shell.Backend diff --git a/lib/jido_shell/environment/sprite.ex b/lib/jido_shell/environment/sprite.ex index 24d139a..a5a24c7 100644 --- a/lib/jido_shell/environment/sprite.ex +++ b/lib/jido_shell/environment/sprite.ex @@ -162,10 +162,6 @@ defmodule Jido.Shell.Environment.Sprite do end end - defp destroy_sprite(nil, _client, _sprites_mod), do: {:error, :missing_sprite_name} - defp destroy_sprite("", _client, _sprites_mod), do: {:error, :missing_sprite_name} - defp destroy_sprite(_sprite_name, nil, _sprites_mod), do: {:error, :missing_sprites_client} - defp destroy_sprite(sprite_name, client, sprites_mod) do with true <- supports?(sprites_mod, :sprite, 2), true <- supports?(sprites_mod, :destroy, 1) do diff --git a/mix.exs b/mix.exs index f25cc1f..9869661 100644 --- a/mix.exs +++ b/mix.exs @@ -74,7 +74,10 @@ defmodule Jido.Shell.MixProject do {:zoi, "~> 0.17"}, {:jido_vfs, "~> 1.0"}, {:bash, - git: "https://github.com/tv-labs/bash.git", ref: "c1038ff83e825c29ea131bf8b728bd1672734c01", optional: true}, + git: "https://github.com/tv-labs/bash.git", + ref: "c1038ff83e825c29ea131bf8b728bd1672734c01", + only: [:dev, :test], + optional: true}, # Dev/Test dependencies {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, @@ -108,8 +111,7 @@ defmodule Jido.Shell.MixProject do defp package do [ - files: - ~w(lib mix.exs LICENSE README.md MIGRATION.md CHANGELOG.md CONTRIBUTING.md GUARDRAILS.md AGENTS.md usage-rules.md .formatter.exs), + files: package_files(), maintainers: ["Mike Hostetler"], licenses: ["Apache-2.0"], links: %{ @@ -122,6 +124,21 @@ defmodule Jido.Shell.MixProject do ] end + defp package_files do + lib_files = + "lib/**/*" + |> Path.wildcard() + |> Enum.reject(&File.dir?/1) + |> Enum.reject(&bash_backend_file?/1) + + lib_files ++ + ~w(mix.exs LICENSE README.md MIGRATION.md CHANGELOG.md CONTRIBUTING.md GUARDRAILS.md AGENTS.md usage-rules.md .formatter.exs) + end + + defp bash_backend_file?("lib/jido_shell/backend/bash.ex"), do: true + defp bash_backend_file?("lib/jido_shell/backend/bash/" <> _), do: true + defp bash_backend_file?(_path), do: false + defp docs do [ main: "readme",