Skip to content

Instantly share code, notes, and snippets.

@chrmoritz
Last active August 16, 2019 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrmoritz/cf4274d7934e295bd08f4c4e28e9a166 to your computer and use it in GitHub Desktop.
Save chrmoritz/cf4274d7934e295bd08f4c4e28e9a166 to your computer and use it in GitHub Desktop.
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.1.tgz"
sha256 "caf5db829121c8518796abeda1c048127859badc086330c06c30ff8c5ed69e67"
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", "jekyll"
assert_predicate testpath/"jekyll/Gemfile", :exist?, "Gemfile must exist"
assert_predicate testpath/"jekyll/index.md", :exist?, "index.md must exist"
assert_predicate testpath/"jekyll/package.json", :exist?, "package.json must exist"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment