mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add a "uname and arch" function, borrowed from update.js.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var os = require("os");
|
||||
var Future = require("fibers/future");
|
||||
var _ = require("underscore");
|
||||
|
||||
@@ -188,5 +189,17 @@ var warehouse = module.exports = {
|
||||
|
||||
_randomToken: function() {
|
||||
return (Math.random() * 0x100000000 + 1).toString(36);
|
||||
},
|
||||
|
||||
_unameAndArch: function () {
|
||||
// Normalize from Node "os.arch()" to "uname -m".
|
||||
var arch = os.arch();
|
||||
if (arch === "ia32")
|
||||
arch = "i686";
|
||||
else if (arch === "x64")
|
||||
arch = "x86_64";
|
||||
else
|
||||
throw new Error("Unsupported architecture " + arch);
|
||||
return os.type() + "-" + arch;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user