File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ class Varlock < Formula
2+ desc "Add declarative schema to .env files using @env-spec decorator comments"
3+ homepage "https://varlock.dev"
4+ url "https://registry.npmjs.org/varlock/-/varlock-0.0.6.tgz"
5+ sha256 "ada6b2a938351f4f6b1ffeec7a1b4a97b3f9a35c586e44e7dfa7fec94fc47e36"
6+ license "MIT"
7+
8+ depends_on "node"
9+
10+ def install
11+ system "npm" , "install" , *std_npm_args
12+ bin . install_symlink Dir [ "#{ libexec } /bin/*" ]
13+ end
14+
15+ test do
16+ assert_match version . to_s , shell_output ( "#{ bin } /varlock --version" )
17+
18+ ( testpath /".env.schema" ) . write <<~TEXT
19+ # This is the header, and may contain root decorators
20+ # @envFlag=APP_ENV
21+ # @defaultSensitive=false @defaultRequired=false
22+ # @generateTypes(lang=ts, path=env.d.ts)
23+ # ---
24+
25+ # This is a config item comment block and may contain decorators which affect only the item
26+ # @required @type=enum(dev, test, staging, prod)
27+ APP_ENV=dev
28+ TEXT
29+
30+ assert_match "dev" , shell_output ( "#{ bin } /varlock load 2>&1" )
31+ end
32+ end
You can’t perform that action at this time.
0 commit comments