#How to get the path of Directory object as a string
1 messages · Page 1 of 1 (latest)
Do you mean the path that it was loaded from on your local filesystem?
Yes, for example:
The command is: dagger call docker-build --directory-arg=any-service
The func:
@function
def docker_build(self, directory_arg: dagger.Directory) -> str:
...
How can I get the string value of directory_arg in the func ?
You cannot get it, by design, because the directory may come from many sources: a git repo, a local directory, or the output of another function. So there is no guarantee that there even is a string.
This is a foundation of Dagger's design, and one reason its composition model is much better than shell scripts or traditional CI