commandbox.system.modules_app.utils-commands.commands.utils

Class normalize-line-endings

lucee.Component
    extended by 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}

Class Attributes:
  • aliases : line-endings
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any pathPatternMatcher


    • access = public
    • returntype = any
    • inject = provider:pathPatternMatcher@globber
    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

    pathPatternMatcher

    property any pathPatternMatcher

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:pathPatternMatcher@globber
    serializable - true

    Method Detail

    filterFiles

    private any filterFiles([any files], [any exclude])

    Parameters:
    files
    exclude

    normalizeLineEndings

    private any normalizeLineEndings([any filePath], [any type], [any verbose])

    Parameters:
    filePath
    type
    verbose

    run

    public any run(commandbox.system.modules_app.utils-commands.commands.utils.Globber files, [String type='unix'], [String exclude=''], [Boolean force='false'], [Boolean verbose='false'])

    Parameters:
    files - A file globbing pattern that matches one or more files
    type - Which type of line ending to use, options: [unix, windows, mac]
    exclude - A list of globbing patterns to ignore
    force - Skip user confirmation of modifying files
    verbose - Output additional information about each file affected