#I am trying to use the defaultpath
1 messages · Page 1 of 1 (latest)
I also tried to do this as a part of a class variable., but that did not work either, but I suspect that might be the proper way to do this
I had to use a constructor to initialize a class variable. I couldn't set it in the declaration itself for some reason...
@object()
class AwsTsContainersDagger {
env: string;
constructor(env = "jeremy-dagger-demo/default/aws-ecs-demo") {
this.env = env
}
had tried
@object()
class AwsTsContainersDagger {
env: string = "jeremy-dagger-demo/default/aws-ecs-demo";
That makes sense but this @argument defaultPath thing is some dagger special sauce I think
Not sure if we even support it here
ah, right, the decorator
@weary socket do you know by chance if this is even supported?
I see, there is no doc about whether @argument works with constructors
https://devel.docs.dagger.io/manuals/developer/functions#directories-and-files
First thing that jumps out to me is that you don't have a type defined for that argument.
Thanks @wet island, you are my hero as usual. I thought I tried that already and ran into some other issue, but I don't remember what it was.
In either case this works!
source: Directory
constructor(@argument({ defaultPath: "." }) source: Directory) {
this.source = source
}