Last active
August 16, 2019 00:20
-
-
Save chrmoritz/cf4274d7934e295bd08f4c4e28e9a166 to your computer and use it in GitHub Desktop.
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
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