Skip to content

Check that path/dir argument is supplied and exists when using "templates apply" #107

@antevens

Description

@antevens

It would be logical to check that the directory/path argument is supplied and that the directory exists.

$ devcontainer.vim templates apply
✔ Ubuntu
/home/ant/.cache/devcontainer.vim/bin/devcontainer aleady exist, use this.
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
main.main.func3(0x367eadb25100)
/home/runner/work/devcontainer.vim/devcontainer.vim/main.go:362 +0xa3f
github.com/urfave/cli/v2.(*Command).Run(0x367eadbf8420, 0x367eadb25100, {0x367eadb18e90, 0x1, 0x1})
/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.7/command.go:276 +0x7c2
github.com/urfave/cli/v2.(*Command).Run(0x367eadbf82c0, 0x367eadb25040, {0x367eadb85260, 0x2, 0x2})
/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.7/command.go:269 +0xa30
github.com/urfave/cli/v2.(*Command).Run(0x367ead4fc9a0, 0x367eadb24d40, {0x367ead02c150, 0x3, 0x3})
/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.7/command.go:269 +0xa30
github.com/urfave/cli/v2.(*App).RunContext(0x367ead4ba000, {0x9eb610, 0xe80100}, {0x367ead02c150, 0x3, 0x3})
/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.7/app.go:333 +0x5a5
github.com/urfave/cli/v2.(*App).Run(...)
/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.27.7/app.go:307
main.main()
/home/runner/work/devcontainer.vim/devcontainer.vim/main.go:1013 +0x28b3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions