@railway/cli 3.0.3 → 3.0.6

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
@@ -18,10 +18,12 @@ The Railway CLI allows you to
18
18
  Currently pre-release. We are looking for feedback and suggestions. Please join our [Discord](https://discord.gg/railway) to provide feedback.
19
19
 
20
20
  ## Installation
21
+
21
22
  ### Cargo
22
23
  ```bash
23
24
  cargo install railwayapp --locked
24
25
  ```
26
+
25
27
  ### Homebrew
26
28
 
27
29
  ```bash
@@ -33,11 +35,20 @@ brew install rlwy
33
35
  ```bash
34
36
  npm install -g @railway/cli
35
37
  ```
38
+
36
39
  ### Bash
37
40
  ```bash
38
- curl -fsSL https://cli.new | sh
41
+ # Install
42
+ bash <(curl -fsSL cli.new)
43
+
44
+ # Uninstall
45
+ bash <(curl -fsSL cli.new) -r
39
46
  ```
40
47
 
48
+ ### Scoop
49
+ ```ps1
50
+ scoop install railway
51
+ ```
41
52
 
42
53
  ### From source
43
54
  See [CONTRIBUTING.md](https://github.com/railwayapp/cli/blob/master/CONTRIBUTING.md) for information on setting up this repo locally.
package/bin/railway.js ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from "child_process";
3
+ import path from "path";
4
+ import { exit } from "process";
5
+ import { fileURLToPath } from "url";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const binName = process.platform === "win32" ? "railway.exe" : "railway";
10
+ try {
11
+ execFileSync(path.resolve(`${__dirname}/${binName}`), process.argv.slice(2), {
12
+ stdio: "inherit",
13
+ });
14
+ } catch (e) {
15
+ exit(1);
16
+ }
@@ -6,7 +6,7 @@ export const CONFIG = {
6
6
  * The name of the binary
7
7
  * @type {string}
8
8
  */
9
- name: "railway",
9
+ name: "railway{{ext}}",
10
10
 
11
11
  /**
12
12
  * Where to save the unzipped files
@@ -20,6 +20,12 @@ async function install() {
20
20
  // Fetch Static Config
21
21
  let { name: binName, path: binPath, url } = CONFIG;
22
22
  let triple = triples.platformArchTriples[process.platform][process.arch][0];
23
+ if (process.platform === "win32") {
24
+ triple.ext = ".exe";
25
+ } else {
26
+ triple.ext = "";
27
+ }
28
+ binName = binName.replace(/{{ext}}/g, triple.ext);
23
29
  url = url.replace(/{{triple}}/g, triple.raw);
24
30
  url = url.replace(/{{version}}/g, version);
25
31
  url = url.replace(/{{bin_name}}/g, binName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railway/cli",
3
- "version": "3.0.3",
3
+ "version": "3.0.6",
4
4
  "description": "Develop and deploy code with zero configuration",
5
5
  "type": "module",
6
6
  "author": "Jake Runzer",