Switch to file_system for better compatibility

Closes #1
This commit is contained in:
Mikko Ahlroth 2017-08-28 20:44:18 +03:00
parent 3c4fa41386
commit 7272eca2a1
5 changed files with 22 additions and 13 deletions

View file

@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is roughly based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [2.0.0] - 2017-08-21
### Changed
- Switched from _fs_ to [_file\_system_](https://hex.pm/packages/file_system), which
should have better support for compiling on different systems.
## [1.0.1] - 2017-06-06
### Changed

View file

@ -87,7 +87,7 @@ by adding `mbu` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:mbu, "~> 1.0.1"}]
[{:mbu, "~> 2.0.0"}]
end
```

View file

@ -211,8 +211,8 @@ defmodule MBU.TaskUtils do
def watch(name, path, fun_or_mod) when is_function(fun_or_mod) do
name_atom = String.to_atom(name)
{:ok, pid} = :fs.start_link(name_atom, String.to_charlist(path))
:fs.subscribe(name_atom)
{:ok, pid} = FileSystem.start_link(name: name_atom, dirs: [String.to_charlist(path)])
FileSystem.subscribe(name_atom)
Logger.debug("[Spawned] Watch #{name}")
@ -304,7 +304,7 @@ defmodule MBU.TaskUtils do
handle_closed(specs, port)
# FS watch sent file event
{_, {:fs, :file_event}, {file, events}} ->
{:file_event, _, {file, events}} ->
handle_events(specs, file, events)
# A watch was triggered after the timeout

14
mix.exs
View file

@ -1,15 +1,18 @@
defmodule MBU.Mixfile do
use Mix.Project
@version "2.0.0"
def project do
[app: :mbu,
version: "1.0.1",
version: @version,
elixir: "~> 1.4",
name: "MBU: Mix Build Utilities",
source_url: "https://github.com/Nicd/mbu",
docs: [
main: "readme",
extras: ["README.md"]
extras: ["README.md"],
source_ref: @version,
source_url: "https://github.com/Nicd/mbu"
],
description: description(),
package: package(),
@ -33,8 +36,7 @@ defmodule MBU.Mixfile do
maintainers: ["Mikko Ahlroth <mikko.ahlroth@gmail.com>"],
licenses: ["BSD 3-clause"],
links: %{
"GitHub" => "https://github.com/Nicd/mbu",
"Docs" => "https://hexdocs.pm/mbu"
"GitHub" => "https://github.com/Nicd/mbu"
}
]
end
@ -59,7 +61,7 @@ defmodule MBU.Mixfile do
defp deps do
[
{:ex_doc, "~> 0.16.0", only: :dev},
{:fs, "~> 2.12.0"}
{:file_system, "~> 0.2.0"}
]
end
end

View file

@ -1,3 +1,3 @@
%{"earmark": {:hex, :earmark, "1.2.2", "f718159d6b65068e8daeef709ccddae5f7fdc770707d82e7d126f584cd925b74", [:mix], []},
"ex_doc": {:hex, :ex_doc, "0.16.1", "b4b8a23602b4ce0e9a5a960a81260d1f7b29635b9652c67e95b0c2f7ccee5e81", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, optional: false]}]},
"fs": {:hex, :fs, "2.12.0", "ad631efacc9a5683c8eaa1b274e24fa64a1b8eb30747e9595b93bec7e492e25e", [:rebar3], []}}
%{"earmark": {:hex, :earmark, "1.2.3", "206eb2e2ac1a794aa5256f3982de7a76bf4579ff91cb28d0e17ea2c9491e46a4", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.16.3", "cd2a4cfe5d26e37502d3ec776702c72efa1adfa24ed9ce723bb565f4c30bd31a", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
"file_system": {:hex, :file_system, "0.2.0", "1b899a8708dd121648b4f4f632022cf8fd989f3d7250621f34eca4831b217ee9", [:mix], [], "hexpm"}}