JsonHunt / save-commands

Assign parametrized shell commands to file globs to be automatically run whenever the file is saved
MIT License
20 stars 11 forks source link

Uncaught TypeError: atom.views.getView(...).find is not a function #24

Closed jacobrs closed 9 years ago

jacobrs commented 9 years ago

This is my save-commands.json

{
    "timeout": 4000,
    "commands": [
        "** : /Users/jacob/custombin/pts"
    ]
}

Atom Version: 1.0.13 System: Mac OS X 10.10.5 Thrown From: save-commands package, v0.6.2

Stack Trace

Uncaught TypeError: atom.views.getView(...).find is not a function

At /Users/jacob/.atom/packages/save-commands/lib/atom-save-commands.coffee:107

TypeError: atom.views.getView(...).find is not a function
    at Object.module.exports.AtomSaveCommands.executeCommand (/Users/jacob/.atom/packages/save-commands/lib/atom-save-commands.coffee:107:44)
    at iterate (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js:146:13)
    at Object.async.eachSeries (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js:162:9)
    at /Users/jacob/.atom/packages/save-commands/lib/atom-save-commands.coffee:259:12
    at /Users/jacob/.atom/packages/save-commands/lib/atom-save-commands.coffee:276:5
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

     -8:01.9.0 core:save (atom-text-editor.editor.is-focused)
     -7:59.4.0 core:backspace (atom-text-editor.editor.is-focused)
  4x -7:58.9.0 core:save (atom-text-editor.editor.is-focused)
  3x -7:56.8.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -7:56.2.0 core:move-down (atom-text-editor.editor.is-focused)
  2x -7:55.3.0 core:move-up (atom-text-editor.editor.is-focused)
  3x -7:54.7.0 core:move-down (atom-text-editor.editor.is-focused)
     -7:53.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -7:53.1.0 core:save (atom-text-editor.editor.is-focused)
  4x -7:41.7.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -7:39.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  3x -7:36.1.0 core:move-left (atom-text-editor.editor.is-focused)
     -7:31.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -7:31.5.0 core:move-right (atom-text-editor.editor.is-focused)
  2x -7:30.5.0 core:backspace (atom-text-editor.editor.is-focused)
  3x -7:28.2.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "audioBeep": false
  }
}

Installed Packages

# User
color-picker, v2.0.11
minimap, v4.13.3
project-manager, v2.5.1
save-commands, v0.6.2
save-session, vundefined

# Dev
No dev packages
jacobrs commented 9 years ago

I ended up fixing this by changing the .find command to .getElementsByClassName. I then ran into a problem with the .prop command and just resolved to commenting those lines out as they seemed to have no impact. Forked a version here. Would like to thank the contributors for this package, has lead to a better workflow.

danielo515 commented 9 years ago

Hello @jacobrs

Why have you close this ticket? The issue is still present, and your fix is the only way to make this package work. I think this is valuable information for everyone. In fact, I think you should do a pull request.

Regards

jacobrs commented 9 years ago

Hello @danielo515

I commented out some code that might have been useful to others (although I haven't seen the effects of that bit of code). I'll do a pull request.