This method provides a formatted display of file mappings, showing the relationship between local files and their target repository paths with visual indicators for file existence.
Usage
# S3 method for class 'file_mapping'
print(x, max_files = 20, ...)
Arguments
- x
An object of class
"file_mapping"
as returned byfile_mapping()
- max_files
Maximum number of files to display. Default is 20.
- ...
Additional arguments passed to other print methods (not used)
Value
Invisibly returns the original file_mapping
object unchanged, allowing for
chained operations.
Displays a formatted representation of the mapping to the console, including:
Total count of mapped files
Visual indicators showing which local files exist (checkmark) or are missing (x)
Source-to-target mapping for each file (limited by
max_files
)
Examples
# Create and display a mapping
mapping <- file_mapping(
"R/functions.R" = "R/utils.R",
dir = system.file(package = "multideploy")
)
#> ! Local file does not exist: R/functions.R
#> ℹ Created file mapping with 22 files
# The mapping is automatically printed when not assigned
# Control how many files are displayed
mapping <- file_mapping(dir = system.file(package = "multideploy"))
#> ℹ Created file mapping with 21 files
print(mapping, max_files = 5) # Show only first 5 mappings
#>
#> ── File Mapping ──
#>
#> 21 files mapped for deployment
#>
#> • ✔ /home/runner/work/_temp/Library/multideploy/DESCRIPTION → DESCRIPTION
#> • ✔ /home/runner/work/_temp/Library/multideploy/INDEX → INDEX
#> • ✔ /home/runner/work/_temp/Library/multideploy/Meta/Rd.rds → Rd.rds
#> • ✔ /home/runner/work/_temp/Library/multideploy/Meta/features.rds →
#> features.rds
#> • ✔ /home/runner/work/_temp/Library/multideploy/Meta/hsearch.rds → hsearch.rds
#>
#> Note: ✔ indicates file exists, ✖ indicates file not found
#> ℹ ... and 16 more files not shown