fuelup icon indicating copy to clipboard operation
fuelup copied to clipboard

feat: export a toolchain into `fuel-toolchain.toml`

Open spiral-ladder opened this issue 3 years ago • 1 comments

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

  1. toolchain name,
  2. 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>

spiral-ladder avatar Dec 19 '22 04:12 spiral-ladder

@bingcicle Hi, I have drafted a PR to close this issue, again looking forward to your review~

Halimao avatar Nov 29 '23 02:11 Halimao