Stremio/stremio-beamup

Allow Setting Defaults

jaruba opened this issue · 4 comments

Scenario

The current proposed command is ./cli/beamup <beamup deployer hostname> add-remote <github username> <addon name>

IMO this is an issue, as addon devs will always need to search for the hostname and add their github user every time they initiate a new addon.

Proposed Solution

beamup --set-server <hostname> --set-user <github user> to set both the server and user as the default for all future use.

Another thought I have about this is that we could save this data in JSON, example:

{
  "server": "...",
  "github": "..."
}

We could use beamup --set-server <hostname> --set-user <github user> to create a global beamup.json, but also allow creating a beamup.json in the project folder (that users will want to deploy) to allow setting per project settings.

The good thing about this is that it's scalable to any number of future settings we might add.

Further thoughts:

My final thoughts on this:

  • server and github user should be set separately with beamup config <server> <github> and used globally
  • if running beamup without a config file, it should ask for a server and github itself and create the config file
  • beamup init should create beamup.json in the project folder with the project folder name as the addon name, alternatively beamup init <addon name> can be used to create a beamup.json file with a custom addon name
  • if running beamup and there is a config file available, but not a beamup.json in the project's path, then it should ask if the project folder name should be used as the addon name, if agreed (or set to a different value) then a beamup.json file will be created and the process will continue

This should make it as simple as just using beamup to deploy, or init, or even config, as this one command will handle all possible scenarios.

A separate project has been built for this purpose: beamup-cli