Skip to content

Commit

Permalink
Fix some simple coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerschtli committed Dec 15, 2019
1 parent 8b315ca commit af5929c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Expand Up @@ -70,7 +70,7 @@ function run() {
}
catch (error) {
core.setFailed(`Action failed with error: ${error}`);
throw (error);
throw error;
}
});
}
Expand Down
26 changes: 13 additions & 13 deletions src/main.ts
@@ -1,25 +1,25 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as tc from '@actions/tool-cache';
import {type} from 'os';
import { type } from 'os';

async function nixConf() {
// Workaround a segfault: https://github.com/NixOS/nix/issues/2733
await exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]);
await exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]);
// Workaround a segfault: https://github.com/NixOS/nix/issues/2733
await exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]);
await exec.exec("sudo", ["sh", "-c", "echo http2 = false >> /etc/nix/nix.conf"]);

// Set jobs to number of cores
await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]);
// Set jobs to number of cores
await exec.exec("sudo", ["sh", "-c", "echo max-jobs = auto >> /etc/nix/nix.conf"]);

// Allow binary caches for runner user
await exec.exec("sudo", ["sh", "-c", "echo trusted-users = root runner >> /etc/nix/nix.conf"]);
// Allow binary caches for runner user
await exec.exec("sudo", ["sh", "-c", "echo trusted-users = root runner >> /etc/nix/nix.conf"]);
}

async function run() {
try {
const PATH = process.env.PATH;
const PATH = process.env.PATH;
const INSTALL_PATH = '/opt/nix';

await nixConf();

// Catalina workaround https://github.com/NixOS/nix/issues/2925
Expand All @@ -36,7 +36,7 @@ async function run() {
}

// Needed due to multi-user being too defensive
core.exportVariable('ALLOW_PREEXISTING_INSTALLATION', "1");
core.exportVariable('ALLOW_PREEXISTING_INSTALLATION', "1");

// TODO: retry due to all the things that go wrong
const nixInstall = await tc.downloadTool('https://nixos.org/nix/install');
Expand All @@ -61,8 +61,8 @@ async function run() {

} catch (error) {
core.setFailed(`Action failed with error: ${error}`);
throw(error);
}
throw error;
}
}

run();

0 comments on commit af5929c

Please sign in to comment.