-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace with Remove unnecessary 'install' instruction Add 'head' instruction Closes #46458. Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
cfc0c69
commit b5888e6
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |