lucee.Component
commandbox.system.modules_app.utils-commands.commands.utils.normalize-line-endings
Normalizes the line endings in a file. Operates on a single file or multiple files as defined by a file globbing pattern. {code:bash} line-endings **.cf* {code} To skip the confirmation, use the --force flag. {code:bash} line-endings models/**.cfc --force {code} Print the file path of each file affected with the --verbose flag. {code:bash} line-endings includes/*.cfm --verbose {code} Exclude a list a globber patterns {code:bash} line-endings ** *.png,node_modules/ {code} You can set global default parameters for this command to use like so: {code:bash} config set command.defaults.line-endings.force=true config set command.defaults.line-endings.verbose=true config set command.defaults.line-endings.exclude=.git/,*.png {code}
| Property Summary | ||||
|---|---|---|---|---|
| type | property | default | serializable | required |
any
|
pathPatternMatcher
|
true
|
false
|
|
| Method Summary | |
|---|---|
private any
|
filterFiles([any files], [any exclude])
|
private any
|
normalizeLineEndings([any filePath], [any type], [any verbose])
|
any
|
run(commandbox.system.modules_app.utils-commands.commands.utils.Globber files, [String type='unix'], [String exclude=''], [Boolean force='false'], [Boolean verbose='false'])
|
| Methods inherited from class lucee.Component |
|---|
| None |
| Property Detail |
|---|
access - publicrequired - falsereturntype - anyinject - provider:pathPatternMatcher@globberserializable - true| Method Detail |
|---|
filesexcludefilePathtypeverbosefiles - A file globbing pattern that matches one or more filestype - Which type of line ending to use, options: [unix, windows, mac]exclude - A list of globbing patterns to ignoreforce - Skip user confirmation of modifying filesverbose - Output additional information about each file affected