-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Implement update function and add to guide
Create a update wrapper calling the internal Copier update. The overwrite=true argument needs to be passed to mimic the CLI behaviour. Updates the guide with specific information to update. ✅ Closes: #113
- Loading branch information
1 parent
6ce66ce
commit e08e64f
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,34 @@ end | |
end | ||
end | ||
|
||
@testset "Compare COPIERTemplate.update vs copier CLI update" begin | ||
mktempdir(TMPDIR; prefix = "cli_") do dir_copier_cli | ||
run(`copier copy --defaults --quiet $min_bash_args $template_url $dir_copier_cli`) | ||
cd(dir_copier_cli) do | ||
run(`git init`) | ||
run(`git add .`) | ||
run(`git config user.name "Test"`) | ||
run(`git config user.email "[email protected]"`) | ||
run(`git commit -q -m "First commit"`) | ||
end | ||
run(`copier update --defaults --quiet $bash_args $dir_copier_cli`) | ||
|
||
mktempdir(TMPDIR; prefix = "update_") do tmpdir | ||
COPIERTemplate.generate(tmpdir, template_minimum_options; defaults = true, quiet = true) | ||
cd(tmpdir) do | ||
run(`git init`) | ||
run(`git add .`) | ||
run(`git config user.name "Test"`) | ||
run(`git config user.email "[email protected]"`) | ||
run(`git commit -q -m "First commit"`) | ||
end | ||
COPIERTemplate.update(tmpdir, template_options; defaults = true, quiet = true) | ||
|
||
test_diff_dir(tmpdir, dir_copier_cli) | ||
end | ||
end | ||
end | ||
|
||
@testset "Testing copy, recopy and rebase" begin | ||
mktempdir(TMPDIR; prefix = "cli_") do dir_copier_cli | ||
run(`copier copy --quiet $bash_args $template_path $dir_copier_cli`) | ||
|