From 6c29ac215832ec535bb359af702c90cc949b3627 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 10 Feb 2025 09:14:37 +0100 Subject: [PATCH] wip --- src/main.rs | 3 ++- src/tests/47_toml/bar.8352856137977294963.o | 1 + src/tests/47_toml/foo.8352856137977294963.o | 1 + src/tests/47_toml/laze-project.toml | 17 +++++++++++++++++ src/tests/47_toml/laze-project.yml | 16 ---------------- 5 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 src/tests/47_toml/bar.8352856137977294963.o create mode 100644 src/tests/47_toml/foo.8352856137977294963.o create mode 100644 src/tests/47_toml/laze-project.toml delete mode 100644 src/tests/47_toml/laze-project.yml diff --git a/src/main.rs b/src/main.rs index 1f26e9b2..74b2ef1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,7 +61,8 @@ pub(crate) fn determine_project_root(start: &Utf8Path) -> Result<(Utf8PathBuf, U if let Some(file) = get_existing_file(cwd.as_path(), &["laze-project.yml", "laze-project.toml"]) { - return Ok((cwd, file)); + let filename = file.file_name().unwrap().into(); + return Ok((cwd, filename)); } cwd = match cwd.parent() { Some(p) => Utf8PathBuf::from(p), diff --git a/src/tests/47_toml/bar.8352856137977294963.o b/src/tests/47_toml/bar.8352856137977294963.o new file mode 100644 index 00000000..5716ca59 --- /dev/null +++ b/src/tests/47_toml/bar.8352856137977294963.o @@ -0,0 +1 @@ +bar diff --git a/src/tests/47_toml/foo.8352856137977294963.o b/src/tests/47_toml/foo.8352856137977294963.o new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/src/tests/47_toml/foo.8352856137977294963.o @@ -0,0 +1 @@ +foo diff --git a/src/tests/47_toml/laze-project.toml b/src/tests/47_toml/laze-project.toml new file mode 100644 index 00000000..4fa04e01 --- /dev/null +++ b/src/tests/47_toml/laze-project.toml @@ -0,0 +1,17 @@ +includes = ["include.toml"] + +[[builders]] +name = "single_builder" +env = { bindir = "build/${builder}/${app}" } + +[[builders.rules]] +name = "CC" +in = 'c' +out = 'o' +cmd = 'cat ${in} > ${out}' + +[[builders.rules]] +name = "LINK" +in = 'o' +cmd = 'cat ${in} > ${out}' + diff --git a/src/tests/47_toml/laze-project.yml b/src/tests/47_toml/laze-project.yml deleted file mode 100644 index dc8fba24..00000000 --- a/src/tests/47_toml/laze-project.yml +++ /dev/null @@ -1,16 +0,0 @@ -builders: - - name: single_builder - rules: - - name: CC - in: 'c' - out: 'o' - cmd: 'cat ${in} > ${out}' - - name: LINK - in: 'o' - cmd: 'cat ${in} > ${out}' - - env: - bindir: build/${builder}/${app} - -includes: - - include.toml