Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up pretty path with filepath.Clean
  • Loading branch information
mafredri committed May 11, 2022
commit 1640e3bed35ec8d639d9b63eaf8fed47934ff946
3 changes: 2 additions & 1 deletion cli/templatecreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ func createValidTemplateVersion(cmd *cobra.Command, client *codersdk.Client, org

// prettyDirectoryPath returns a prettified path when inside the users
// home directory. Falls back to dir if the users home directory cannot
// discerned.
// discerned. This function calls filepath.Clean on the result.
func prettyDirectoryPath(dir string) string {
dir = filepath.Clean(dir)
homeDir, err := os.UserHomeDir()
if err != nil {
return dir
Expand Down