dwaring87 / rtm-cli

Remember the Milk Command Line Interface
MIT License
66 stars 14 forks source link

Plugins not loaded #16

Open daniel-barrows opened 5 years ago

daniel-barrows commented 5 years ago

I'm running rtm 1.5.1 retrieved from a pre-built binary. I can't get plugins to load. I have been trying both rtm-cli-plugin-example and rtm-plugin-export. I tried manually setting the plugin directory path in the configuration file to no avail. Is this an issue with pre-built binaries or what?

dwaring87 commented 5 years ago

I just tested the export plugin with a pre-built binary, so that shouldn't be an issue. What OS are you using?

This is the configuration file I have:

{
  "dateformat": "ddd mmm d",
  "hideDue": 14,
  "aliases": [
    {
      "name": "today",
      "description": "Display tasks with a priority, due or completed today, or overdue",
      "command": "lsp",
      "args": "(not priority:none and status:incomplete) or completed:today or (dueBefore:tomorrow and status:incomplete)"
    }
  ],
  "plugins": [
    "~/.rtm.plugins/"
  ]
}

Then, the ~/.rtm.plugins/ directory contains:

.
└── plugin-export
    ├── LICENSE
    ├── README.md
    ├── export.js
    ├── index.js
    ├── node_modules
    │   ├── rtm-api 
    │   └── rtm-cli 
    └── package.json
chriswil commented 5 years ago

I'm having a similar problem on Mac OS. My plugin-export directory doesn't contain the 'node_modules' directory. Is that something that's created at runtime? Or did I miss a node config step?

jondcoleman commented 4 years ago

In regards to plugin-export, it requires rtm-cli and rtm-api as peer dependencies. Therefore, I think in order for it to work as it is, it needs to be placed into the rtm-cli directory. Otherwise, those require statements will cause the package to fail and the plugin will not be loaded. I could be wrong but that's the only way I could get it to work.

jondcoleman commented 4 years ago
.
└── plugin-export
    ├── LICENSE
    ├── README.md
    ├── export.js
    ├── index.js
    ├── node_modules
    │   ├── rtm-api 
    │   └── rtm-cli 
    └── package.json

This doesn't make sense with how that package is set up because the packages are listed as peer dependencies rather than pure dependencies, so even if you npm install, you won't get those packages in this plugin directory.

jonhind commented 3 years ago

Ubuntu 20.10 : I fixed this by running sudo npm install rtm-cliin the export sub directory of ~.rtm.plugins/ I suspect this may have been a sledgehammer approach !