feat: throw error if the platform is not linux

This commit is contained in:
Kengo TODA
2020-08-28 19:41:36 +08:00
parent 52b82a3e33
commit 0cc2e1f005
3 changed files with 22 additions and 3 deletions

12
dist/index.js vendored
View File

@@ -91,7 +91,7 @@ function runCommand(command) {
});
}
exports.runCommand = runCommand;
function install(version) {
function installOnLinux(version) {
return __awaiter(this, void 0, void 0, function* () {
const system = runCommand('uname -s');
const hardware = runCommand('uname -m');
@@ -101,6 +101,16 @@ function install(version) {
return installerPath;
});
}
function install(version) {
return __awaiter(this, void 0, void 0, function* () {
switch (process.platform) {
case 'linux':
return installOnLinux(version);
default:
throw new Error(`Unsupported platform: ${process.platform}`);
}
});
}
exports.install = install;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long