diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-06 19:27:05 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-06 19:27:05 -0600 |
commit | a61f65cbd5aea86715689527aad2a4f1c5063b99 (patch) | |
tree | 990148d46ef1cf9220b8a3f24608edebafe2b172 /src | |
parent | c94a7f83e3d9f3fb7cd023efee33a4434af5c349 (diff) | |
download | makers-a61f65cbd5aea86715689527aad2a4f1c5063b99.tar.gz makers-a61f65cbd5aea86715689527aad2a4f1c5063b99.zip |
implement function `abspath`
Diffstat (limited to 'src')
-rw-r--r-- | src/makefile/functions.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/makefile/functions.rs b/src/makefile/functions.rs index c111fba..51bf0f9 100644 --- a/src/makefile/functions.rs +++ b/src/makefile/functions.rs @@ -85,6 +85,10 @@ pub fn expand_call( assert_eq!(args.len(), 1); file_name::realpath(macros, &args[0]) } + "abspath" => { + assert_eq!(args.len(), 1); + file_name::abspath(macros, &args[0]) + } "if" => { assert!(args.len() == 2 || args.len() == 3); @@ -382,6 +386,11 @@ mod file_name { .collect::<Vec<_>>(); Ok(results.join(" ")) } + + pub fn abspath(macros: &MacroSet, targets: &TokenString) -> Result<String> { + // TODO don't resolve symlinks + realpath(macros, targets) + } } // Functions for Conditionals |