@rescript/tools
Advanced tools
Comparing version
{ | ||
"name": "@rescript/tools", | ||
"description": "ReScript Tools", | ||
"version": "0.1.3", | ||
"version": "0.3.0", | ||
"author": "ReScript Team", | ||
@@ -39,4 +39,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"rescript": "^11.0.0-rc.4" | ||
"rescript": "^11.0.0-rc.7" | ||
} | ||
} |
{ | ||
"name": "@rescript/tools", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"sources": [ | ||
@@ -5,0 +5,0 @@ { |
@@ -7,2 +7,3 @@ #!/usr/bin/env node | ||
var Path = require("path"); | ||
var Js_dict = require("rescript/lib/js/js_dict.js"); | ||
var Js_json = require("rescript/lib/js/js_json.js"); | ||
@@ -60,13 +61,10 @@ var Belt_List = require("rescript/lib/js/belt_List.js"); | ||
filePath | ||
]); | ||
], { | ||
stdio: "inherit" | ||
}); | ||
var code = spawn.status; | ||
if (code !== null) { | ||
if (code !== 0) { | ||
logAndExit(spawn.stderr.toString(), code); | ||
} else { | ||
logAndExit(spawn.stdout.toString(), code); | ||
} | ||
} else { | ||
logAndExit("error: unexpected error to extract docs for " + filePath, 1); | ||
process.exit(code); | ||
} | ||
} | ||
@@ -88,12 +86,8 @@ } | ||
var args$1 = ["reanalyze"].concat(Belt_List.toArray(match.tl)); | ||
var spawn$1 = Child_process.spawnSync(analysisProdPath, args$1); | ||
var spawn$1 = Child_process.spawnSync(analysisProdPath, args$1, { | ||
stdio: "inherit" | ||
}); | ||
var code$1 = spawn$1.status; | ||
if (code$1 !== null) { | ||
if (code$1 !== 0) { | ||
logAndExit(spawn$1.stderr.toString(), code$1); | ||
} else { | ||
logAndExit(spawn$1.stdout.toString(), code$1); | ||
} | ||
} else { | ||
logAndExit("error: unexpected error to run reanalyze with arguments: " + args$1.join(" "), 1); | ||
process.exit(code$1); | ||
} | ||
@@ -116,5 +110,11 @@ break; | ||
} else { | ||
var dict = Js_json.decodeObject(JSON.parse(Fs.readFileSync("./package.json"))); | ||
var packageJson = Path.join(__dirname, "..", "package.json"); | ||
var dict = Js_json.decodeObject(JSON.parse(Fs.readFileSync(packageJson))); | ||
if (dict !== undefined) { | ||
logAndExit(Caml_option.valFromOption(dict)["version"], 0); | ||
var version = Js_dict.get(Caml_option.valFromOption(dict), "version"); | ||
if (version !== undefined) { | ||
logAndExit(version, 0); | ||
} else { | ||
logAndExit("error: failed to find version in package.json", 1); | ||
} | ||
} else { | ||
@@ -121,0 +121,0 @@ logAndExit("error: failed to find version in package.json", 1); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44631353
0.1%127
-0.78%Updated