Skip to content

Commit 97605f6

Browse files
PetarKirovmonyarm
authored andcommitted
refactor(mcl.commands.deploy_spec): Remove unused parameters and use spawnProcessInline
1 parent 4764a53 commit 97605f6

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed
Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
module mcl.commands.deploy_spec;
22

3-
import std.stdio : writeln;
4-
import mcl.utils.env : parseEnv;
5-
import mcl.utils.process : execute;
6-
import mcl.utils.path : rootDir;
3+
import std.logger : warningf;
4+
import std.file : exists;
5+
import std.path : buildPath;
76

8-
export void deploy_spec()
9-
{
10-
const params = parseEnv!Params;
11-
12-
writeln(execute([
13-
"cachix", "deploy", "activate", rootDir ~ "cachix-deploy-spec.json",
14-
"--async"
15-
]));
7+
import mcl.utils.process : spawnProcessInline;
8+
import mcl.utils.path : resultDir;
169

17-
}
10+
import mcl.commands.ci_matrix : ci_matrix;
1811

19-
struct Params
12+
export void deploy_spec()
2013
{
21-
string cachixAuthToken;
22-
string cachixCache;
14+
auto deploySpecFile = resultDir.buildPath("cachix-deploy-spec.json");
2315

24-
void setup()
16+
if (!deploySpecFile.exists)
2517
{
18+
warningf("'%s' file not found - building...", deploySpecFile);
19+
ci_matrix();
2620
}
21+
22+
spawnProcessInline([
23+
"cachix", "deploy", "activate", deploySpecFile
24+
]);
2725
}

0 commit comments

Comments
 (0)