From d2fe9719589796e0182fce2aba65c8eb50c041e3 Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 7 Aug 2019 22:35:34 +0800 Subject: [PATCH] now-cli 16.1.2 (new formula) Closes #41998. Signed-off-by: FX Coudert --- Formula/now-cli.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Formula/now-cli.rb diff --git a/Formula/now-cli.rb b/Formula/now-cli.rb new file mode 100644 index 0000000000..bdcd587ac2 --- /dev/null +++ b/Formula/now-cli.rb @@ -0,0 +1,24 @@ +require "language/node" + +class NowCli < Formula + desc "The command-line interface for Now" + homepage "https://zeit.co/now" + url "https://registry.npmjs.org/now/-/now-16.1.2.tgz" + sha256 "c4e2c599e99918b2e7cf1e71ae4ff06888264fb13d6656c4c0407e3608575bfc" + + depends_on "node" + + def install + rm Dir["dist/{*.exe,xsel}"] + inreplace "dist/index.js", "t.default=getUpdateCommand", + "t.default=async()=>'brew upgrade now-cli'" + system "npm", "install", *Language::Node.std_npm_install_args(libexec) + bin.install_symlink Dir["#{libexec}/bin/*"] + end + + test do + system "#{bin}/now", "init", "markdown" + assert_predicate testpath/"markdown/now.json", :exist?, "now.json must exist" + assert_predicate testpath/"markdown/README.md", :exist?, "README.md must exist" + end +end