fuelup
fuelup copied to clipboard
feat: export a toolchain into `fuel-toolchain.toml`
This is an issue for a proposed new command: fuelup toolchain export <toolchain>
This should generate a fuel-toolchain.toml in the Sway project root containing
- toolchain name,
- components in the toolchain.
Example flow:
$ fuelup default
my-toolchain (default)
$ fuelup show
...
active toolchain
-----------------
my-toolchain (default)
forc : 0.31.1
- forc-client
- forc-deploy : 0.31.1
- forc-run : 0.31.1
- forc-doc : 0.31.1
- forc-explore - not found
- forc-fmt : 0.31.1
- forc-index : 0.1.10
- forc-lsp : 0.31.1
- forc-wallet - not found
fuel-core - not found
fuel-indexer - not found
$ fuelup toolchain export
exported 'my-toolchain' into 'fuel-toolchain.toml'
This should then create a TOML file:
[toolchain]
name = "my-toolchain"
[components]
forc = "0.31.3" # note that 'forc-fmt', 'forc-lsp', 'forc-doc', 'forc-client' are packaged with 'forc'
forc-index = "0.1.10"
The command should fail when there's an existing fuel-toolchain.toml in the project root. A --force flag should be added to disregard the existing TOML file:
fuelup toolchain export --force <toolchain>
@bingcicle Hi, I have drafted a PR to close this issue, again looking forward to your review~