UNPKG

dotnet-2.0.0

Version:

Platform agnostic installation of .NET Core runtime 2.0.0

34 lines 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path_1 = require("path"); const os_1 = require("os"); const fs_1 = require("fs"); exports.basename = require("../package.json").basename; const dotnetVersion = "2.0.0"; exports.basePath = process.env.DOTNET_SHARED_HOME || path_1.normalize(`${os_1.homedir()}/.net/${dotnetVersion}`); const architecture = process.env.DOTNET_SHARED_ARCH || detectArchitecture(); exports.dotnetPackageName = `${exports.basename}-${dotnetVersion}-${architecture}`; exports.installationPath = path_1.join(exports.basePath, `node_modules/${exports.dotnetPackageName}/`); exports.packageJsonPath = path_1.join(exports.installationPath, "package.json"); exports.fileExists = (path) => { try { return fs_1.statSync(path).isFile(); } catch (_a) { return false; } }; function detectArchitecture() { switch (os_1.platform()) { case 'darwin': return 'osx'; case 'linux': return `linux`; case 'win32': switch (os_1.arch()) { case 'x64': return 'win'; case 'x86': case 'ia32': return 'win-x86'; } break; } throw new Error(`Unsupported Platform: ${os_1.platform()}`); } //# sourceMappingURL=common.js.map