create-uix-app 1.0.0 → 1.1.0

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/package.json +1 -1
  2. package/src/index.js +12 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-uix-app",
3
3
  "description": "Creates a starter project for UIx2 web app",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "author": {
6
6
  "name": "Roman Liutikov"
7
7
  },
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  const fs = require("fs");
2
3
  const path = require("path");
3
4
  const { exec } = require("child_process");
@@ -11,11 +12,20 @@ program
11
12
  .name(pkg.name)
12
13
  .description(pkg.description)
13
14
  .version(pkg.version)
14
- .argument("<project-name>", "directory where a project will be created");
15
+ .argument("<project-name>", "directory where a project will be created")
16
+ .option("--re-frame", "add re-frame setup");
15
17
 
16
18
  program.parse();
17
19
 
18
20
  const [projectName] = program.args;
21
+ const { reFrame } = program.opts();
22
+
23
+ const masterUrl =
24
+ "https://github.com/pitch-io/uix-starter/archive/master.tar.gz";
25
+ const reframeUrl =
26
+ "https://github.com/pitch-io/uix-starter/archive/re-frame.tar.gz";
27
+
28
+ const downloadUrl = reFrame ? reframeUrl : masterUrl;
19
29
 
20
30
  if (!projectName) {
21
31
  program.help();
@@ -24,7 +34,7 @@ if (!projectName) {
24
34
  "Downloading project template from https://github.com/pitch-io/uix-starter..."
25
35
  );
26
36
  axios
27
- .get("https://github.com/pitch-io/uix-starter/archive/master.tar.gz", {
37
+ .get(downloadUrl, {
28
38
  responseType: "stream",
29
39
  })
30
40
  .then(