smipper 8.0.0 → 11.0.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/index.js +15 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,8 +3,10 @@
3
3
 
4
4
  const fs = require("fs");
5
5
  const got = require("got");
6
+ const path = require("path");
6
7
  const sourceMap = require("source-map");
7
8
  const url = require("url");
9
+
8
10
  let verbose = false;
9
11
  let stack;
10
12
  let json = false;
@@ -25,6 +27,9 @@ for (let i=2; i<process.argv.length; ++i) {
25
27
  stack = fs.readFileSync(arg.substr(7)).toString();
26
28
  } else if (arg === "--verbose" || arg === "-v") {
27
29
  verbose = true;
30
+ } else if (arg === "--version") {
31
+ console.log(JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).version);
32
+ process.exit(0);
28
33
  } else if (arg === "--json") {
29
34
  json = true;
30
35
  } else if (arg === "--jsc") { // jsc has the wrong column for some reason
@@ -32,11 +37,11 @@ for (let i=2; i<process.argv.length; ++i) {
32
37
  } else if (arg.startsWith("--retries")) {
33
38
  retries = parseInt(arg.substr(9));
34
39
  if (isNaN(retries) || retries < 0) {
35
- console.error("smipper [stack|-h|--help|-v|--verbose|--retries=<number>|--jsc|--json|-f=@FILE@|-");
40
+ console.error("smipper [stack|-h|--help|-v|--verbose|--version|--retries=<number>|--jsc|--json|-f=@FILE@|-");
36
41
  process.exit(1);
37
42
  }
38
43
  } else if (arg === "-h" || arg === "--help") {
39
- console.error("smipper [stack|-h|--help|-v|--verbose|--retries=<number>|--jsc|--json|-f=@FILE@|-");
44
+ console.error("smipper [stack|-h|--help|-v|--verbose|--version|--retries=<number>|--jsc|--json|-f=@FILE@|-");
40
45
  process.exit(0);
41
46
  } else if (arg === "-") {
42
47
  // stdin
@@ -68,6 +73,14 @@ function load(path)
68
73
  }
69
74
  return;
70
75
  }
76
+ if (!path.startsWith("http://") && !path.startsWith("https://")) {
77
+ reject(new Error("Not a url"));
78
+ return;
79
+ }
80
+ if (path.startsWith("http://localcontrol.netflix.com/")) {
81
+ reject(new Error("No need to resolve this one"));
82
+ return;
83
+ }
71
84
  let retryIndex = 0;
72
85
  async function get()
73
86
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smipper",
3
- "version": "8.0.0",
3
+ "version": "11.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {