crcl-cli 0.0.1 → 26.3.1

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.
Files changed (2) hide show
  1. package/bin/install.js +5 -2
  2. package/package.json +19 -17
package/bin/install.js CHANGED
@@ -19,11 +19,12 @@ const PLATFORMS = {
19
19
  "win32-x64": { artifact: "crcl-windows-amd64", ext: ".zip" },
20
20
  };
21
21
 
22
- function download(url) {
22
+ function download(url, redirects = 0) {
23
+ if (redirects > 5) return Promise.reject(new Error("Too many redirects"));
23
24
  return new Promise((resolve, reject) => {
24
25
  https.get(url, (res) => {
25
26
  if (res.statusCode === 302 || res.statusCode === 301) {
26
- return download(res.headers.location).then(resolve).catch(reject);
27
+ return download(res.headers.location, redirects + 1).then(resolve).catch(reject);
27
28
  }
28
29
  if (res.statusCode !== 200) return reject(new Error(`HTTP ${res.statusCode}`));
29
30
  const chunks = [];
@@ -34,7 +35,9 @@ function download(url) {
34
35
  });
35
36
  }
36
37
 
38
+ // Skip in CI or when developing from source
37
39
  if (process.env.CI) process.exit(0);
40
+ if (fs.existsSync(path.join(__dirname, "..", "src"))) process.exit(0);
38
41
 
39
42
  const platform = `${process.platform}-${process.arch}`;
40
43
  const info = PLATFORMS[platform];
package/package.json CHANGED
@@ -1,27 +1,29 @@
1
1
  {
2
- "name": "crcl-cli",
3
- "version": "0.0.1",
4
- "description": "Circles CLI — manage orgs, API keys, and authenticate with circles.ac",
5
- "type": "module",
6
2
  "bin": {
7
3
  "crcl": "bin/crcl.mjs"
8
4
  },
9
- "files": ["bin"],
10
- "scripts": {
11
- "build": "bun build src/index.ts --compile --outfile crcl",
12
- "dev": "bun run src/index.ts",
13
- "test": "vitest run",
14
- "test:coverage": "vitest run --coverage",
15
- "postinstall": "node bin/install.js"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/circlesac/crcl.git"
20
- },
5
+ "description": "Circles CLI — manage orgs, API keys, and authenticate with circles.ac",
21
6
  "devDependencies": {
22
7
  "@types/bun": "latest",
23
8
  "@vitest/coverage-v8": "^4.1.0",
24
9
  "typescript": "^5.9.3",
25
10
  "vitest": "^4.1.0"
26
- }
11
+ },
12
+ "files": [
13
+ "bin"
14
+ ],
15
+ "name": "crcl-cli",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/circlesac/crcl.git"
19
+ },
20
+ "scripts": {
21
+ "build": "bun build src/index.ts --compile --outfile crcl",
22
+ "dev": "bun run src/index.ts",
23
+ "postinstall": "node bin/install.js",
24
+ "test": "vitest run",
25
+ "test:coverage": "vitest run --coverage"
26
+ },
27
+ "type": "module",
28
+ "version": "26.3.1"
27
29
  }