Skip to content

Commit

Permalink
Recompile inotifywait.exe; test w/ Elixir 1.18 (#103)
Browse files Browse the repository at this point in the history
Recently updated version does not match the bundled sources
and probably came from the upstream, which currently doesn't watch
for closed STDIN which Port needs to cleanly shut down the process.

Recompile bundled sources that do have the feature and update the
binary.
  • Loading branch information
dtcaciuc authored Jan 5, 2025
1 parent d6d7721 commit 4a660e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- pair:
elixir: 1.17.x
otp: 27.x
- pair:
elixir: 1.18.x
otp: 27.x

steps:
- uses: erlef/setup-beam@v1
Expand Down
Binary file modified priv/inotifywait.exe
Binary file not shown.
12 changes: 9 additions & 3 deletions test/file_system_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ defmodule FileSystemTest do
@moduletag os_linux: true, os_macos: true, os_windows: true

test "file event api" do
tmp_dir = System.cmd("mktemp", ["-d"]) |> elem(0) |> String.trim()
:ok = File.mkdir_p(tmp_dir)
tmp_dir = mktemp_d!()
on_exit(fn -> File.rm_rf!(tmp_dir) end)

{:ok, pid} = FileSystem.start_link(dirs: [tmp_dir])
FileSystem.subscribe(pid)

Expand Down Expand Up @@ -34,7 +35,12 @@ defmodule FileSystemTest do
|> Enum.each(&Port.close/1)

assert_receive {:file_event, ^pid, :stop}, 5000
end

File.rm_rf!(tmp_dir)
defp mktemp_d!() do
name = for _ <- 1..10, into: "", do: <<Enum.random(~c'0123456789abcdef')>>
path = Path.join([System.tmp_dir!(), name])
File.mkdir_p!(path)
path
end
end

0 comments on commit 4a660e0

Please sign in to comment.