@fosenai/cord-linux-arm64 0.1.0-alpha.2 → 0.1.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cord ADDED
Binary file
package/package.json CHANGED
@@ -1,22 +1,13 @@
1
1
  {
2
2
  "name": "@fosenai/cord-linux-arm64",
3
- "version": "0.1.0-alpha.2",
4
- "description": "Cord — linux-arm64 prebuilt binary (downloaded from GitHub Releases on install).",
5
- "license": "Apache-2.0",
6
- "os": [
7
- "linux"
8
- ],
9
- "cpu": [
10
- "arm64"
11
- ],
12
- "scripts": {
13
- "postinstall": "node scripts/download.js"
14
- },
15
- "files": [
16
- "scripts/"
17
- ],
3
+ "version": "0.1.0-alpha.21",
4
+ "description": "Cord Rust CLI — linux-arm64 prebuilt",
5
+ "license": "BUSL-1.1",
6
+ "os": ["linux"],
7
+ "cpu": ["arm64"],
8
+ "files": ["cord"],
18
9
  "repository": {
19
10
  "type": "git",
20
- "url": "git+https://github.com/fosenai/cord.git"
11
+ "url": "git+https://github.com/your-org/cord.git"
21
12
  }
22
- }
13
+ }
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
- // Download platform-specific cord binary from GitHub Releases.
3
- const fs = require('node:fs')
4
- const path = require('node:path')
5
- const https = require('node:https')
6
-
7
- const pkgRoot = path.resolve(__dirname, '..')
8
- const pkg = require(path.join(pkgRoot, 'package.json'))
9
- const platform = pkg.name.replace('@fosenai/cord-', '')
10
- const ext = platform.startsWith('win') ? '.exe' : ''
11
- const outFile = path.join(pkgRoot, 'cord' + ext)
12
- const url = `https://github.com/fosenai/cord/releases/download/v${pkg.version}/cord-${platform}${ext}`
13
-
14
- console.log(`[cord/${platform}] downloading ${url}`)
15
-
16
- function download(url, dest, redirects = 5) {
17
- return new Promise((resolve, reject) => {
18
- https.get(url, { headers: { 'User-Agent': 'cord-npm-installer' } }, (res) => {
19
- if ([301, 302, 303, 307, 308].includes(res.statusCode)) {
20
- if (redirects <= 0) return reject(new Error('too many redirects'))
21
- const next = res.headers.location
22
- res.destroy()
23
- return download(next, dest, redirects - 1).then(resolve, reject)
24
- }
25
- if (res.statusCode !== 200) {
26
- return reject(new Error(`HTTP ${res.statusCode}`))
27
- }
28
- const out = fs.createWriteStream(dest, { mode: 0o755 })
29
- res.pipe(out)
30
- out.on('finish', () => out.close(resolve))
31
- out.on('error', reject)
32
- }).on('error', reject)
33
- })
34
- }
35
-
36
- ;(async () => {
37
- try {
38
- await download(url, outFile)
39
- fs.chmodSync(outFile, 0o755)
40
- console.log(`[cord/${platform}] installed at ${outFile}`)
41
- } catch (e) {
42
- console.error(`[cord/${platform}] download failed: ${e.message}`)
43
- console.error(`[cord/${platform}] manually: curl -L -o cord ${url} && chmod +x cord`)
44
- process.exitCode = 1
45
- }
46
- })()