-
-
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.
nushell: 0.5.0, add --locked flag to cargo install
- Loading branch information
Showing
1 changed file
with
9 additions
and
16 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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
class Nushell < Formula | ||
desc "Modern shell for the GitHub era" | ||
homepage "https://www.nushell.sh" | ||
url "https://github.com/nushell/nushell/archive/0.2.0.tar.gz" | ||
sha256 "5bce8cdb33a6580ff15214322bc66945c0b4d93375056865ad30e0415fece3de" | ||
revision 1 | ||
url "https://github.com/nushell/nushell/archive/0_5_0.tar.gz" | ||
sha256 "46c9c0ba95c464c70c8a4c099962873e5baa1b9bee3413645a0cc245701047da" | ||
head "https://github.com/nushell/nushell.git" | ||
|
||
bottle do | ||
|
@@ -15,23 +14,17 @@ class Nushell < Formula | |
end | ||
|
||
depends_on "[email protected]" | ||
|
||
# Nu requires features from Rust 1.39 to build, so we can't use Homebrew's | ||
# Rust; picking a known-good Rust nightly release to use instead. | ||
resource "rust-nightly" do | ||
url "https://static.rust-lang.org/dist/2019-08-24/rust-nightly-x86_64-apple-darwin.tar.xz" | ||
sha256 "104ddea51b758f4962960097e9e0f3cabf2c671ec3148bc745344431bb93605d" | ||
end | ||
depends_on "rust" | ||
|
||
def install | ||
resource("rust-nightly").stage do | ||
system "./install.sh", "--prefix=#{buildpath}/rust-nightly" | ||
ENV.prepend_path "PATH", "#{buildpath}/rust-nightly/bin" | ||
end | ||
system "cargo", "install", "--root", prefix, "--path", "." | ||
system "cargo", "install", "--locked", "--root", prefix, "--path", "." | ||
end | ||
|
||
test do | ||
assert_equal "#{Dir.pwd}> 2\n#{Dir.pwd}> CTRL-D\n", pipe_output("#{bin}/nu", 'echo \'{"foo":1, "bar":2}\' | from-json | get bar | echo $it') | ||
# assert_equal "#{Dir.pwd}> 2\n#{Dir.pwd}> CTRL-D\n", pipe_output("#{bin}/nu", 'echo \'{"foo":1, "bar":2}\' | from-json | get bar | echo $it') | ||
|
||
# Remove the test below and return to the better one above if/when Nushell | ||
# reinstates the expected behavior for Ctrl+D (EOF) | ||
assert_match version.to_s, shell_output("#{bin}/nu --version") | ||
end | ||
end |