aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules/fs.py')
-rw-r--r--mesonbuild/modules/fs.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py
index f4b8080..254749d 100644
--- a/mesonbuild/modules/fs.py
+++ b/mesonbuild/modules/fs.py
@@ -29,14 +29,6 @@ class FSModule(ExtensionModule):
super().__init__(interpreter)
self.snippets.add('generate_dub_file')
- @stringArgs
- @noKwargs
- def exists(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
- if len(args) != 1:
- MesonException('method takes exactly one argument.')
- test_file = Path(state.source_root) / state.subdir / args[0]
- return ModuleReturnValue(test_file.exists(), [])
-
def _check(self, check: str, state: 'ModuleState', args: typing.Sequence[str]) -> ModuleReturnValue:
if len(args) != 1:
MesonException('method takes exactly one argument.')
@@ -45,6 +37,11 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
+ def exists(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ return self._check('exists', state, args)
+
+ @stringArgs
+ @noKwargs
def is_symlink(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
return self._check('is_symlink', state, args)