Title: | Create Useful .gitignore Files for your Project |
---|---|
Description: | Simple interface to query gitignore.io to fetch gitignore templates that can be included in the .gitignore file. More than 450 templates are currently available. |
Authors: | Philippe Massicotte [aut, cre] , Amanda Dobbyn [rev], Mauro Lepore [rev] |
Maintainer: | Philippe Massicotte <[email protected]> |
License: | GPL-3 |
Version: | 0.1.8.9000 |
Built: | 2024-11-01 21:15:00 UTC |
Source: | https://github.com/ropensci/gitignore |
This return list of all templates supported by gitignore.io.
gi_available_templates()
gi_available_templates()
The returned list is returned as lower case characters.
A character with all templates supported by gitignore.io.
gi_available_templates()
gi_available_templates()
Fetch gitignore template(s) from gitignore.io
gi_fetch_templates( template_name, copy_to_clipboard = FALSE, append_gitignore = FALSE, gitignore_file = here::here(".gitignore") )
gi_fetch_templates( template_name, copy_to_clipboard = FALSE, append_gitignore = FALSE, gitignore_file = here::here(".gitignore") )
template_name |
A character vector with values included in
|
copy_to_clipboard |
Logical. Should the returned template(s) be copied to the clipboard? Otherwise, it will be printed in the console. Default is FALSE. |
append_gitignore |
Logical. Should the .gitignore be modified to include the returned template(s)? |
gitignore_file |
The path of the .gitignore file to be modified. By default, it will try to find it in the current package/project using 'here::here(".gitignore")'. |
A character containing gitignore template(s).
# Fetch template for the R language gi_fetch_templates("R") # You can combine many templates at once gi_fetch_templates(c("R", "python", "java")) # The .gitignore file can be automatically modified with `append_gitignore = TRUE` gi_fetch_templates(c("R", "python", "java"))
# Fetch template for the R language gi_fetch_templates("R") # You can combine many templates at once gi_fetch_templates(c("R", "python", "java")) # The .gitignore file can be automatically modified with `append_gitignore = TRUE` gi_fetch_templates(c("R", "python", "java"))
Use the returned template(s) to append the existing .gitignore file.
gi_write_gitignore(fetched_template, gitignore_file = here::here(".gitignore"))
gi_write_gitignore(fetched_template, gitignore_file = here::here(".gitignore"))
fetched_template |
Template(s) returned by 'gi_fetch_templates()'. |
gitignore_file |
Path of the .gitignore file to modify. |
TRUE if succeeds to write/append the .gitignore, FALSE otherwise.
## Not run: f <- file.path(tempdir(), ".gitignore") new_lines <- gi_fetch_templates("r") gi_write_gitignore(new_lines, f) unlink(f) ## End(Not run)
## Not run: f <- file.path(tempdir(), ".gitignore") new_lines <- gi_fetch_templates("r") gi_write_gitignore(new_lines, f) unlink(f) ## End(Not run)