mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: resolve template name from working directory "." (#6822)
This commit is contained in:
+6
-1
@@ -85,8 +85,13 @@ func (pf *templateUploadFlags) templateName(args []string) (string, error) {
|
||||
if len(args) > 0 {
|
||||
return args[0], nil
|
||||
}
|
||||
// Have to take absPath to resolve "." and "..".
|
||||
absPath, err := filepath.Abs(pf.directory)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
// If no name is provided, use the directory name.
|
||||
return filepath.Base(pf.directory), nil
|
||||
return filepath.Base(absPath), nil
|
||||
}
|
||||
|
||||
func (r *RootCmd) templatePush() *clibase.Cmd {
|
||||
|
||||
Reference in New Issue
Block a user