A directory.
| 4306 | |
| 4307 | @typecheck |
| 4308 | class Directory(Type): |
| 4309 | """A directory.""" |
| 4310 | |
| 4311 | def as_git(self) -> "GitRepository": |
| 4312 | """Converts this directory to a local git repository""" |
| 4313 | _args: list[Arg] = [] |
| 4314 | _ctx = self._select("asGit", _args) |
| 4315 | return GitRepository(_ctx) |
| 4316 | |
| 4317 | def as_module( |
| 4318 | self, |
| 4319 | *, |
| 4320 | source_root_path: str | None = ".", |
| 4321 | ) -> "Module": |
| 4322 | """Load the directory as a Dagger module source |
| 4323 | |
| 4324 | Parameters |
| 4325 | ---------- |
| 4326 | source_root_path: |
| 4327 | An optional subpath of the directory which contains the module's |
| 4328 | configuration file. |
| 4329 | If not set, the module source code is loaded from the root of the |
| 4330 | directory. |
| 4331 | """ |
| 4332 | _args = [ |
| 4333 | Arg("sourceRootPath", source_root_path, "."), |
| 4334 | ] |
| 4335 | _ctx = self._select("asModule", _args) |
| 4336 | return Module(_ctx) |
| 4337 | |
| 4338 | def as_module_source( |
| 4339 | self, |
| 4340 | *, |
| 4341 | source_root_path: str | None = ".", |
| 4342 | ) -> "ModuleSource": |
| 4343 | """Load the directory as a Dagger module source |
| 4344 | |
| 4345 | Parameters |
| 4346 | ---------- |
| 4347 | source_root_path: |
| 4348 | An optional subpath of the directory which contains the module's |
| 4349 | configuration file. |
| 4350 | If not set, the module source code is loaded from the root of the |
| 4351 | directory. |
| 4352 | """ |
| 4353 | _args = [ |
| 4354 | Arg("sourceRootPath", source_root_path, "."), |
| 4355 | ] |
| 4356 | _ctx = self._select("asModuleSource", _args) |
| 4357 | return ModuleSource(_ctx) |
| 4358 | |
| 4359 | def changes(self, from_: Self) -> Changeset: |
| 4360 | """Return the difference between this directory and another directory, |
| 4361 | typically an older snapshot. |
| 4362 | |
| 4363 | The difference is encoded as a changeset, which also tracks removed |
| 4364 | files, and can be applied to other directories. |
| 4365 |
no outgoing calls
no test coverage detected