Skip to content

Commit d5ea3f6

Browse files
committed
varlock 0.0.6 (new formula)
Signed-off-by: Patrick Linnane <[email protected]>
1 parent af6be5d commit d5ea3f6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Formula/v/varlock.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

0 commit comments

Comments
 (0)