Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitdffcb71

Browse files
committed
feat: add brew formula for macOS
1 parent7fcfe98 commitdffcb71

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

‎.github/workflows/test.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,10 @@ jobs:
5353
uses:./ci/image
5454
with:
5555
args:./ci/steps/gendocs.sh
56+
brew_installs:
57+
runs-on:macos-latest
58+
steps:
59+
-uses:actions/checkout@v1
60+
-run:brew install --build-from-source ./coder.rb
61+
-run:coder --version
62+

‎ci/scripts/lib.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import{exec}from'https://cdn.depjs.com/exec/mod.ts'
2+
3+
exportconstcurrentDir=`${newURL(".",import.meta.url).pathname}/../`
4+
5+
exportconstprojectRoot=async()=>exec("git rev-parse --show-toplevel")
6+
7+
exportconststring=(a:Uint8Array):string=>newTextDecoder().decode(a)
8+
9+
exportconstbytes=(a:string):Uint8Array=>newTextEncoder().encode(a)
10+
11+
exportconstread=async(path:string):Promise<string>=>
12+
string(awaitDeno.readFile(path))
13+
14+
exportconstwrite=async(path:string,data:string):Promise<void>=>
15+
Deno.writeFile(path,bytes(data))

‎ci/scripts/update_brew.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env -S deno run --allow-all
2+
import{projectRoot,write}from"./lib.ts"
3+
4+
Deno.chdir(awaitprojectRoot())
5+
6+
interfaceParams{
7+
sha:string
8+
version:string
9+
}
10+
11+
consttemplate=({ sha, version}:Params)=>`class Coder < Formula
12+
desc "A command-line tool for the Coder remote development platform"
13+
homepage "https://github.com/cdr/coder-cli"
14+
url "https://github.com/cdr/coder-cli/releases/download/${version}/coder-cli-darwin-amd64-${version}.zip"
15+
sha256 "${sha}"
16+
bottle :unneeded
17+
def install
18+
bin.install "coder"
19+
end
20+
test do
21+
system "#{bin}/coder", "--version"
22+
end
23+
end
24+
`
25+
26+
if(Deno.args.length<2){
27+
throwError("2 args required")
28+
}
29+
30+
constversion=Deno.args[0]
31+
constsha=Deno.args[1]
32+
33+
awaitwrite("./coder.rb",template({ sha, version}))

‎coder.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
classCoder <Formula
2+
desc"A command-line tool for the Coder remote development platform"
3+
homepage"https://github.com/cdr/coder-cli"
4+
url"https://github.com/cdr/coder-cli/releases/download/v1.14.2/coder-cli-darwin-amd64-v1.14.2.zip"
5+
sha256"69b69497a75ce19851681974aa7561af7c7061357f8616e24446e58795bf6e1f"
6+
bottle:unneeded
7+
definstall
8+
bin.install"coder"
9+
end
10+
testdo
11+
system"#{bin}/coder","--version"
12+
end
13+
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp