Skip to content

Commit d756e40

Browse files
committed
fix build function
1 parent 93340fe commit d756e40

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fluentci/rust",
3-
"version": "0.9.1",
3+
"version": "0.9.2",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

example/.fluentci/src/dagger/jobs.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description This module provides a set of functions to build, test, and run clippy on a Rust project 🦀
44
*/
55

6-
import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts";
6+
import { dag, env, Directory, DirectoryID, File } from "../../deps.ts";
77

88
export enum Job {
99
clippy = "clippy",
@@ -185,13 +185,13 @@ export async function build(
185185
.withMountedCache("/app/target", dag.cacheVolume("target"))
186186
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
187187
.withExec(
188-
packageName
188+
env.has("PACKAGE_NAME") || packageName
189189
? [
190190
"cargo",
191191
"build",
192192
"--release",
193193
"-p",
194-
packageName,
194+
env.get("PACKAGE_NAME") || packageName!,
195195
"--target",
196196
target,
197197
...options,
@@ -203,6 +203,7 @@ export async function build(
203203
const result = await ctr.stdout();
204204

205205
console.log(result);
206+
await ctr.directory(`/${target}`).export("./target");
206207
return ctr.directory(`/${target}`).id();
207208
}
208209

src/dagger/jobs.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description This module provides a set of functions to build, test, and run clippy on a Rust project 🦀
44
*/
55

6-
import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts";
6+
import { dag, env, Directory, DirectoryID, File } from "../../deps.ts";
77

88
export enum Job {
99
clippy = "clippy",
@@ -185,13 +185,13 @@ export async function build(
185185
.withMountedCache("/app/target", dag.cacheVolume("target"))
186186
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
187187
.withExec(
188-
packageName
188+
env.has("PACKAGE_NAME") || packageName
189189
? [
190190
"cargo",
191191
"build",
192192
"--release",
193193
"-p",
194-
packageName,
194+
env.get("PACKAGE_NAME") || packageName!,
195195
"--target",
196196
target,
197197
...options,
@@ -203,6 +203,7 @@ export async function build(
203203
const result = await ctr.stdout();
204204

205205
console.log(result);
206+
await ctr.directory(`/${target}`).export("./target");
206207
return ctr.directory(`/${target}`).id();
207208
}
208209

0 commit comments

Comments
 (0)