Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
3 changes: 2 additions & 1 deletion lib/jido_shell/backend/bash.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions lib/jido_shell/environment/sprite.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 20 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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: %{
Expand All @@ -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",
Expand Down