Type: Package
Title: Create Useful .gitignore Files for your Project
Version: 0.1.8
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.
License: GPL-3
URL: https://docs.ropensci.org/gitignore/, https://github.com/ropensci/gitignore
BugReports: https://github.com/ropensci/gitignore/issues
Imports: cli, clipr, curl, glue, here, jsonlite, purrr, xfun
Suggests: covr, knitr, rmarkdown, spelling, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.2
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2024-11-01 11:51:41 UTC; filoche
Author: Philippe Massicotte ORCID iD [aut, cre], Amanda Dobbyn [rev], Mauro Lepore ORCID iD [rev]
Maintainer: Philippe Massicotte <pmassicotte@hotmail.com>
Repository: CRAN
Date/Publication: 2024-11-01 12:10:02 UTC

gitignore: 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.

Author(s)

Maintainer: Philippe Massicotte pmassicotte@hotmail.com (ORCID)

Other contributors:

See Also

Useful links:


Fetch available templates from gitignore.io

Description

This return list of all templates supported by gitignore.io.

Usage

gi_available_templates()

Details

The returned list is returned as lower case characters.

Value

A character with all templates supported by gitignore.io.

Examples


gi_available_templates()


Fetch gitignore template(s) from gitignore.io

Description

Fetch gitignore template(s) from gitignore.io

Usage

gi_fetch_templates(
  template_name,
  copy_to_clipboard = FALSE,
  append_gitignore = FALSE,
  gitignore_file = here::here(".gitignore")
)

Arguments

template_name

A character vector with values included in gi_available_templates.

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")'.

Value

A character containing gitignore template(s).

Examples


# 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"))


Append or create a .gitignore file

Description

Use the returned template(s) to append the existing .gitignore file.

Usage

gi_write_gitignore(fetched_template, gitignore_file = here::here(".gitignore"))

Arguments

fetched_template

Template(s) returned by 'gi_fetch_templates()'.

gitignore_file

Path of the .gitignore file to modify.

Value

TRUE if succeeds to write/append the .gitignore, FALSE otherwise.

Examples

## Not run: 
f <- file.path(tempdir(), ".gitignore")
new_lines <- gi_fetch_templates("r")
gi_write_gitignore(new_lines, f)

unlink(f)

## End(Not run)