kumarabhirup / bulk-mail-cli

Do quick, hassle-free email marketing with this small but very powerful tool! 🔥
https://bulkmail.now.sh
GNU General Public License v3.0
121 stars 24 forks source link

`settings.json` can only be found at the root of bulk-mail-cli repo #4

Closed kumarabhirup closed 5 years ago

kumarabhirup commented 5 years ago

If I ran bulkmail in a folder which is not bulk-mail-cli, i.e Desktop or Documents,

I see this error:

(node:1330) UnhandledPromiseRejectionWarning: Error: Cannot find module '/Users/iqubex/Desktop/.config/settings.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at new BulkMailCli_settings (/Users/iqubex/Sites/bulk-mail-cli/src/dist/src/utils/settings.util.js:45:24)
    at _callee$ (/Users/iqubex/Sites/bulk-mail-cli/src/dist/src/utils/settings.util.js:97:44)
    at tryCatch (/Users/iqubex/Sites/bulk-mail-cli/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/iqubex/Sites/bulk-mail-cli/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/iqubex/Sites/bulk-mail-cli/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/iqubex/Sites/bulk-mail-cli/src/dist/src/utils/settings.util.js:17:191)
(node:1330) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1330) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It is probably because of the use of process.cwd() method for assigning the SETTINGS_PATH variable.

THIS IS SO SILLY BUG!!