@itsbjoern/roost 0.1.7 → 0.1.8

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/README.md CHANGED
@@ -5,15 +5,18 @@ This is the npm wrapper for the Roost CLI. It downloads a prebuilt `roost` binar
5
5
  ### Install
6
6
 
7
7
  ```bash
8
+ # Global install — use `roost` from anywhere:
8
9
  npm install -g @itsbjoern/roost
9
- # or as a dependency:
10
+
11
+ # Local install — use via npx:
10
12
  npm install @itsbjoern/roost
11
13
  ```
12
14
 
13
15
  Then (CLI):
14
16
 
15
17
  ```bash
16
- roost init
18
+ roost init # after global install
19
+ npx roost init # after local install
17
20
  ```
18
21
 
19
22
  ### JavaScript API
Binary file
package/install.js CHANGED
@@ -112,16 +112,26 @@ async function main() {
112
112
  cwd: binDir,
113
113
  });
114
114
 
115
- const exeName = process.platform === "win32" ? "roost.exe" : "roost";
116
- const binPath = path.join(binDir, exeName);
115
+ const extractedName = process.platform === "win32" ? "roost.exe" : "roost";
116
+ const extractedPath = path.join(binDir, extractedName);
117
117
 
118
- const exists = fs.existsSync(binPath);
118
+ const exists = fs.existsSync(extractedPath);
119
119
  if (!exists) {
120
120
  throw new Error(
121
- `Extracted archive did not contain expected binary at ${binPath}`
121
+ `Extracted archive did not contain expected binary at ${extractedPath}`
122
122
  );
123
123
  }
124
124
 
125
+ // On Unix, archive contains "roost" which would overwrite the Node wrapper.
126
+ // Rename to roost-bin so bin/roost stays as the wrapper script.
127
+ let binPath;
128
+ if (process.platform === "win32") {
129
+ binPath = extractedPath; // already bin/roost.exe
130
+ } else {
131
+ binPath = path.join(binDir, "roost-bin");
132
+ await fs.promises.rename(extractedPath, binPath);
133
+ }
134
+
125
135
  if (process.platform !== "win32") {
126
136
  await fs.promises.chmod(binPath, 0o755);
127
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itsbjoern/roost",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Roost CLI - local HTTPS reverse proxy with automatic cert management",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",