Skip to content

Commit 75beece

Browse files
authored
Merge pull request #3 from tsirysndr/verify-nix
verify if nix is installed
2 parents 59c4138 + 4dc2882 commit 75beece

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

dist/setup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export default async () => {
1111
if (process.platform === "win32") {
1212
throw new Error("Flox is not supported on Windows");
1313
}
14+
// verify that nix is installed
15+
const { exitCode } = await getExecOutput("nix", ["--version"]);
16+
if (exitCode !== 0) {
17+
throw new Error("Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action");
18+
}
1419
const cacheKey = `floxcache-${process.platform}-${process.arch}`;
1520
const cacheEnabled = cache.isFeatureAvailable();
1621
let cacheHit = false;

src/setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ export default async (): Promise<{
1616
if (process.platform === "win32") {
1717
throw new Error("Flox is not supported on Windows");
1818
}
19+
// verify that nix is installed
20+
const { exitCode } = await getExecOutput("nix", ["--version"]);
21+
if (exitCode !== 0) {
22+
throw new Error(
23+
"Nix is not installed, please install it first, see https://github.com/DeterminateSystems/nix-installer-action"
24+
);
25+
}
1926
const cacheKey = `floxcache-${process.platform}-${process.arch}`;
2027
const cacheEnabled = cache.isFeatureAvailable();
2128
let cacheHit = false;

0 commit comments

Comments
 (0)