Skip to content

Commit

Permalink
fix: do not require a directory for remote urls (#1283)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>
  • Loading branch information
Reecepbcups and jtieri authored Oct 19, 2024
1 parent 664ae63 commit 6717d03
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions local-interchain/cmd/local-ic/start_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ local-ic start https://pastebin.com/raw/Ummk4DTM
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
configPath := args[0]
parentDir := GetDirectory()
isURL := strings.HasPrefix(configPath, "http")

var (
parentDir string
config *types.Config
err error
)

if path.IsAbs(configPath) {
dir, err := filepath.Abs(configPath)
Expand All @@ -48,10 +54,7 @@ local-ic start https://pastebin.com/raw/Ummk4DTM
configPath = filepath.Base(configPath)
}

var config *types.Config
var err error

if strings.HasPrefix(configPath, "http") {
if isURL {
config, err = interchain.LoadConfigFromURL(configPath)
if err != nil {
panic(err)
Expand All @@ -60,6 +63,8 @@ local-ic start https://pastebin.com/raw/Ummk4DTM
// last part of the URL to be the test name
configPath = configPath[strings.LastIndex(configPath, "/")+1:]
} else {
parentDir = GetDirectory()

configPath, err = GetConfigWithExtension(parentDir, configPath)
if err != nil {
panic(err)
Expand Down

0 comments on commit 6717d03

Please sign in to comment.