Skip to content

Commit

Permalink
Merge pull request #3 from tsirysndr/verify-nix
Browse files Browse the repository at this point in the history
verify if nix is installed
  • Loading branch information
tsirysndr committed Mar 20, 2023
2 parents 59c4138 + 4dc2882 commit 75beece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default async () => {
if (process.platform === "win32") {
throw new Error("Flox is not supported on Windows");
}
// verify that nix is installed
const { exitCode } = await getExecOutput("nix", ["--version"]);
if (exitCode !== 0) {
throw new Error("Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action");
}
const cacheKey = `floxcache-${process.platform}-${process.arch}`;
const cacheEnabled = cache.isFeatureAvailable();
let cacheHit = false;
Expand Down
7 changes: 7 additions & 0 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default async (): Promise<{
if (process.platform === "win32") {
throw new Error("Flox is not supported on Windows");
}
// verify that nix is installed
const { exitCode } = await getExecOutput("nix", ["--version"]);
if (exitCode !== 0) {
throw new Error(
"Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action"
);
}
const cacheKey = `floxcache-${process.platform}-${process.arch}`;
const cacheEnabled = cache.isFeatureAvailable();
let cacheHit = false;
Expand Down

0 comments on commit 75beece

Please sign in to comment.