Skip to content

Commit

Permalink
Diesel 1.4.3 (new formula)
Browse files Browse the repository at this point in the history
Replace with

Remove unnecessary 'install' instruction

Add 'head' instruction

Closes #46458.

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
zengxs authored and chenrui333 committed Dec 4, 2019
1 parent cfc0c69 commit b5888e6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Formula/diesel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Diesel < Formula
desc "Command-line tool for Rust ORM Diesel"
homepage "https://diesel.rs"
url "https://github.com/diesel-rs/diesel/archive/v1.4.3.tar.gz"
sha256 "79769964028e5cc85219d100d4945d69a5d2ec5a4125c36fd50b9ef1dc326d5a"

head "https://github.com/diesel-rs/diesel.git"

depends_on "rust" => [:build, :test]
depends_on "libpq"
depends_on "mysql-client"
uses_from_macos "sqlite"

def install
system "cargo", "install", "--root", prefix, "--path", "diesel_cli"

system "#{bin}/diesel completions bash > diesel.bash"
system "#{bin}/diesel completions zsh > _diesel"
system "#{bin}/diesel completions fish > diesel.fish"

bash_completion.install "diesel.bash"
zsh_completion.install "_diesel"
fish_completion.install "diesel.fish"
end

test do
ENV["DATABASE_URL"] = "db.sqlite"
system "cargo", "init"
system bin/"diesel", "setup"
assert_predicate testpath/"db.sqlite", :exist?, "SQLite database should be created"
end
end

0 comments on commit b5888e6

Please sign in to comment.