<commit_before>class FatihFileFinderPlugin extends FatihPluginAbstract

  constructor: (options = {}, data) ->

    options.name          = "File Finder"
    options.keyword       = "find"
    options.notFoundText  = "This is not the file you're looking for!"

    super options, data

    @on "ListItemClicked", -> @fatihView.destroy()

  action: (keyword) ->
    # path    = "/Users/#{KD.whoami().profile.nickname}/"
    # command = "find '#{path}' -type f -iname '*#{keyword}*'"
    path = "."

    command =
      kiteName : "os"
      method   : "exec"
      withArgs : "find '#{path}' -type f -iname '*#{keyword}*'"

    @getSingleton('kiteController').run command, (err, res) =>
      @searchHelper keyword, @parseResponse res

  searchHelper: (keyword, files) ->
    return @fatihView.emit "PluginFoundNothing" if files.length is 0

    @emit "FatihPluginCreatedAList", files, FatihFileListItem

  parseResponse: (res) ->
    files     = []

    if res
      paths   = res.replace(/\/Users/g, "Users").split '\n'
      files.push { path } for path in paths when path and path.indexOf("Users") is 0

    return files<commit_msg>Fixed file finder plugin's path for os kite<commit_after>class FatihFileFinderPlugin extends FatihPluginAbstract

  constructor: (options = {}, data) ->

    options.name          = "File Finder"
    options.keyword       = "find"
    options.notFoundText  = "This is not the file you're looking for!"

    super options, data

    @on "ListItemClicked", -> @fatihView.destroy()

  action: (keyword) ->
    path    = "/home/#{KD.whoami().profile.nickname}/"
    command = "find \"#{path}\" -type f -iname \"*#{keyword}*\""

    @getSingleton('kiteController').run command, (err, res) =>
      @searchHelper keyword, @parseResponse res

  searchHelper: (keyword, files) ->
    return @fatihView.emit "PluginFoundNothing" if files.length is 0

    @emit "FatihPluginCreatedAList", files, FatihFileListItem

  parseResponse: (res) ->
    files     = []

    if res
      paths   = res.replace(/\/Users/g, "Users").split '\n'
      files.push { path } for path in paths when path and path.indexOf("Users") is 0

    return files
{'fraction_non_alphanumeric': 0.1412691060676239, 'fraction_numerical': 0.0018527095877721167, 'mean_word_length': 2.9201451905626135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6274096', 'n_tokens_mistral': 701, 'n_tokens_neox': 658, 'n_words': 185}