File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,13 +206,16 @@ func main() {
206206 ipfsCfg , err = readIPFSConfig (defaultIpfsConfig , ipfsConfigPath )
207207 if err != nil {
208208 if os .IsNotExist (err ) {
209- // File doesn't exist, create it in main
209+ // File doesn't exist, copy the template to disk
210210 if err := copyDefaultIPFSConfig (defaultIpfsConfig , ipfsConfigPath ); err != nil {
211211 panic (fmt .Sprintf ("Failed to create empty config file: %v" , err ))
212212 }
213+ // Re-read the just-copied config so ipfsCfg has the template values
214+ ipfsCfg , err = readIPFSConfig (defaultIpfsConfig , ipfsConfigPath )
215+ if err != nil {
216+ panic (fmt .Sprintf ("Failed to read IPFS config after copying template: %v" , err ))
217+ }
213218 } else {
214- // Unexpected error, handle appropriately (e.g., logging, retrying)
215- // For now, panic for demonstration:
216219 panic (fmt .Sprintf ("Failed to read or create IPFS config: %v" , err ))
217220 }
218221 }
You can’t perform that action at this time.
0 commit comments