-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
3,425 additions
and
144 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare const module_dir_path: string; | ||
export declare function execSyncInherit(cmd: string, options?: any): void; | ||
export declare function find_module_path(module_name: string, root_module_path: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("rejection-tracker").main(__dirname, "..", ".."); | ||
var child_process = require("child_process"); | ||
var scriptLib = require("../tools/scriptLib"); | ||
var path = require("path"); | ||
exports.module_dir_path = path.join(__dirname, "..", ".."); | ||
function execSyncInherit(cmd, options) { | ||
if (options === void 0) { options = {}; } | ||
console.log(scriptLib.colorize("$ " + cmd, "YELLOW") + "\n"); | ||
child_process.execSync(cmd, __assign({ "stdio": "inherit" }, options)); | ||
} | ||
exports.execSyncInherit = execSyncInherit; | ||
function find_module_path(module_name, root_module_path) { | ||
var cmd = [ | ||
"dirname $(", | ||
"find " + path.join(root_module_path, "node_modules") + " ", | ||
"-type f -path \\*/node_modules/" + module_name + "/package.json", | ||
")" | ||
].join(""); | ||
var match = child_process | ||
.execSync(cmd, { "stdio": [] }) | ||
.toString("utf8") | ||
.split("\n"); | ||
match.pop(); | ||
if (!match.length) { | ||
throw new Error("Not found"); | ||
} | ||
else { | ||
return match.sort(function (a, b) { return a.length - b.length; })[0]; | ||
} | ||
} | ||
exports.find_module_path = find_module_path; | ||
var working_directory_path = path.join(exports.module_dir_path, "working_directory"); | ||
if (require.main === module) { | ||
var dist_dir_name_1 = [ | ||
"dongle", | ||
"v" + require(path.join(exports.module_dir_path, "package.json"))["version"], | ||
child_process.execSync("uname -m").toString("utf8").replace("\n", "") | ||
].join("_"); | ||
console.log({ dist_dir_name: dist_dir_name_1 }); | ||
var dist_dir_path_1 = path.join(working_directory_path, dist_dir_name_1); | ||
(function () { | ||
var tmp_dir_path = path.join("/tmp", dist_dir_name_1); | ||
execSyncInherit("rm -rf " + tmp_dir_path); | ||
execSyncInherit("cp -r " + exports.module_dir_path + " " + tmp_dir_path); | ||
execSyncInherit("rm -rf " + dist_dir_path_1); | ||
execSyncInherit("mv " + tmp_dir_path + " " + dist_dir_path_1); | ||
})(); | ||
execSyncInherit("cp " + path.join(working_directory_path, "node") + " " + dist_dir_path_1); | ||
(function () { | ||
var node_python_messaging_path = find_module_path("node-python-messaging", dist_dir_path_1); | ||
execSyncInherit("rm -r " + path.join(node_python_messaging_path, "dist", "virtual")); | ||
})(); | ||
(function () { | ||
var udev_module_path = find_module_path("udev", dist_dir_path_1); | ||
execSyncInherit("rm -r " + path.join(udev_module_path, "build")); | ||
})(); | ||
try { | ||
for (var _a = __values([".git", ".gitignore", "src", "tsconfig.json"]), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var name = _b.value; | ||
execSyncInherit("rm -r " + path.join(dist_dir_path_1, name)); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
try { | ||
for (var _d = __values(["@types", "typescript"]), _e = _d.next(); !_e.done; _e = _d.next()) { | ||
var name = _e.value; | ||
execSyncInherit("rm -r " + path.join(dist_dir_path_1, "node_modules", name)); | ||
} | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (_e && !_e.done && (_f = _d.return)) _f.call(_d); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
execSyncInherit("find " + path.join(dist_dir_path_1, "node_modules") + " -type f -name \"*.ts\" -exec rm -rf {} \\;"); | ||
execSyncInherit("rm -r " + path.join(dist_dir_path_1, path.basename(working_directory_path))); | ||
execSyncInherit("tar -czf " + path.join(working_directory_path, dist_dir_name_1 + ".tar.gz") + " -C " + dist_dir_path_1 + " ."); | ||
execSyncInherit("rm -r " + dist_dir_path_1); | ||
console.log("---DONE---"); | ||
//mkdir foo | ||
//tar -xzf bar.tar.gz -C foo | ||
// /usr/share | ||
} | ||
var e_1, _c, e_2, _f; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (this && this.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var path = require("path"); | ||
var build_dist_tarball_1 = require("./build_dist_tarball"); | ||
var fs = require("fs"); | ||
var node_path = path.join(build_dist_tarball_1.module_dir_path, "node"); | ||
var bin_dir_path = path.join(build_dist_tarball_1.module_dir_path, "dist", "bin"); | ||
var args = (function () { | ||
var out = __spread(process.argv); | ||
out.shift(); | ||
out.shift(); | ||
return out.map(function (v) { return "\"" + v + "\""; }).join(" "); | ||
})(); | ||
var runInstaller = function () { return build_dist_tarball_1.execSyncInherit(node_path + " " + path.join(bin_dir_path, "installer.js") + " install " + args); }; | ||
if (!!args.match(/\-\-help/) || !!args.match(/\-h/)) { | ||
runInstaller(); | ||
process.exit(0); | ||
} | ||
build_dist_tarball_1.execSyncInherit(node_path + " " + path.join(bin_dir_path, "install_prereq")); | ||
(function build_udev() { | ||
var udev_dir_path = build_dist_tarball_1.find_module_path("udev", build_dist_tarball_1.module_dir_path); | ||
if (fs.existsSync(path.join(udev_dir_path, "build"))) { | ||
return; | ||
} | ||
var pre_gyp_dir_path = ""; | ||
try { | ||
for (var _a = __values([udev_dir_path, build_dist_tarball_1.module_dir_path]), _b = _a.next(); !_b.done; _b = _a.next()) { | ||
var root_module_path = _b.value; | ||
try { | ||
pre_gyp_dir_path = build_dist_tarball_1.find_module_path("node-pre-gyp", root_module_path); | ||
break; | ||
} | ||
catch (_c) { } | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_b && !_b.done && (_d = _a.return)) _d.call(_a); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
build_dist_tarball_1.execSyncInherit([ | ||
"PATH=" + path.join(build_dist_tarball_1.module_dir_path) + ":$PATH", | ||
"node " + path.join(pre_gyp_dir_path, "bin", "node-pre-gyp") + " install", | ||
"--fallback-to-build" | ||
].join(" "), { "cwd": udev_dir_path }); | ||
var e_1, _d; | ||
})(); | ||
(function postinstall_node_python_messaging() { | ||
var node_python_messaging_dir_path = build_dist_tarball_1.find_module_path("node-python-messaging", build_dist_tarball_1.module_dir_path); | ||
if (fs.existsSync(path.join(node_python_messaging_dir_path, "dist", "virtual"))) { | ||
return; | ||
} | ||
build_dist_tarball_1.execSyncInherit("./install-python-dep.sh", { "cwd": node_python_messaging_dir_path }); | ||
})(); | ||
runInstaller(); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Oops, something went wrong.