Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Show errors when running on unsupported platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
masa-iwasaki committed Dec 10, 2019
1 parent fe45649 commit d26abe6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const exec = __importStar(require("@actions/exec"));
function intallRbenv(options) {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec('sudo', ['git', 'clone', 'https://github.com/rbenv/rbenv.git', options.rbenvRoot]);
// TODO: Add README that PATH should be set by users
// await exec.exec('export', ['PATH="$HOME/.rbenv/bin:$PATH"']);
});
}
exports.intallRbenv = intallRbenv;
Expand Down
3 changes: 3 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const installer = __importStar(require("./installer"));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (process.platform !== 'linux') {
core.error(`Not a supported platform. Only Linux is supported.`);
}
let options = {
rbenvRoot: "/home/runner/.rbenv",
rbenvRootOwner: "runner"
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@types/jest": "^24.0.13",
"@types/node": "^12.0.4",
"@types/node": "^12.12.16",
"jest": "^24.8.0",
"jest-circus": "^24.7.1",
"ts-jest": "^24.0.2",
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import * as core from '@actions/core';
import * as installer from './installer';
import { exec } from 'child_process';

async function run() {
try {

if (process.platform !== 'linux') {
core.error(`Not a supported platform. Only Linux is supported.`);
}

let options: installer.RbenvOptions = {
rbenvRoot: "/home/runner/.rbenv",
rbenvRootOwner: "runner"
Expand Down

0 comments on commit d26abe6

Please sign in to comment.