morten-olsen / mini-loader

Easy-to-use workload manager for small-scale tasks and applications, prioritizing simplicity over scalability.
GNU General Public License v3.0
2 stars 2 forks source link

Setup issue with the preferences file #41

Closed denissb closed 9 months ago

denissb commented 9 months ago

Issue when trying to set-up the tool I get an exception when trying to follow the setup instructions, seems like there needs to be a preferences file generated for the lib.

See output:

➜  test-mini-loader mini-loader auth login
? Enter the host of your server http://localhost:4500
? Enter your token [hidden]
✔ Getting auth status
✔ Saving login
Error: ENOENT: no such file or directory, open '/Users/denissb/Library/Preferences/mini-loader-nodejs/contexts/default'
    at Object.openSync (node:fs:581:18)
    at writeFileSync (node:fs:2342:35)
    at Context.save (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/context/context.ts:46:5)
    at Context.saveLogin (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/context/context.ts:37:10)
    at file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/commands/auth/auth.login.ts:44:19
    at step (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/utils/step.ts:6:26)
    at Command.<anonymous> (file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/commands/auth/auth.login.ts:43:9)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Command.parseAsync (/Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/node_modules/commander/lib/command.js:936:5)
    at file:///Users/denissb/.nvm/versions/node/v20.10.0/lib/node_modules/@morten-olsen/mini-loader-cli/src/index.ts:36:1

To Reproduce Follow the setup instructions till step:

# Authenticate the CLI
mini-loader auth login

Expected behavior The token should be saved and the CLI should be authorized.

morten-olsen commented 9 months ago

Missing await on directory creation - fixed in https://github.com/morten-olsen/mini-loader/commit/e5064ca905cd63c0d5f796976b19573e66bbcc81