Improve paths validation/expansion on fuels init
command #3406
Closed
Description
When running this:
mkdir temp && cd temp && \
pnpm init && pnpm add fuels && \
forc new --contract counter && \
pnpm fuels init --contracts ./counter/* --output ./sway-types && \
cat fuels.config.ts
We end up with:
// fuels.config.ts
import { createConfig } from 'fuels';
export default createConfig({
contracts: [
'counter/Forc.toml',
],
output: './src/sway-types',
});
Notes:
- If you try to build the resulting project with
pnpm fuels build
, you'll get an error - The contract's path should be
counter
and notcounter/Forc.toml
- Perhaps this is caused by using a wildcard in
./counter/*
during theinit
command — note that thecounter
directory does not contains other/multiple contracts inside of it. It is the contract.
We should review the path's validation and expansion and improve tests around this.