Skip to content

Commit

Permalink
Fix paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jul 25, 2023
1 parent 75803c3 commit 4e19fc2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
8 changes: 7 additions & 1 deletion crates/cli/src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,13 @@ pub async fn generate(name: String, options: GenerateOptions) -> AppResult {
FileState::Replace => color::muted("->"),
_ => color::muted("-->"),
},
color::muted_light(relative_dest.join(file.name).as_str())
color::muted_light(
file.dest_path
.strip_prefix(&cwd)
.unwrap_or(&file.dest_path)
.to_str()
.unwrap()
)
))?;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Template title (dry run)
Some description of the template and its files.


created --> ./test/file.ts
created --> ./test/file.txt
created --> ./test/folder/nested-file.ts
created --> ./test/other.raw.txt
created --> test/file.ts
created --> test/file.txt
created --> test/folder/nested-file.ts
created --> test/other.txt



Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Template title
Some description of the template and its files.


created --> ./test/file.ts
created --> ./test/file.txt
created --> ./test/folder/nested-file.ts
created --> ./test/other.raw.txt
created --> test/file.ts
created --> test/file.txt
created --> test/folder/nested-file.ts
created --> test/other.txt



Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
source: crates/cli/tests/generate_test.rs
assertion_line: 174
expression: get_path_safe_output(&assert)
expression: assert.output_standardized()
---

Variable testing
A template for testing all variable config combinations.


created --> ./test/control.txt
created --> ./test/expressions.txt
created --> ./test/file-default-0.txt
created --> ./test/filters.txt
created --> test/control.txt
created --> test/expressions.txt
created --> test/file-default-0.txt
created --> test/filters.txt



Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Template title
Some description of the template and its files.


replaced -> ./test/file.ts
replaced -> ./test/file.txt
replaced -> ./test/folder/nested-file.ts
replaced -> ./test/other.raw.txt
replaced -> test/file.ts
replaced -> test/file.txt
replaced -> test/folder/nested-file.ts
replaced -> test/other.txt



Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
source: crates/cli/tests/generate_test.rs
assertion_line: 108
expression: get_path_safe_output(&assert)
expression: assert.output_standardized()
---

Variable testing
A template for testing all variable config combinations.


replaced -> ./test/control.txt
replaced -> ./test/expressions.txt
replaced -> ./test/file-default-0.txt
replaced -> ./test/filters.txt
replaced -> test/control.txt
replaced -> test/expressions.txt
replaced -> test/file-default-0.txt
replaced -> test/filters.txt



0 comments on commit 4e19fc2

Please sign in to comment.