Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1640e3b

Browse files
committedMay 11, 2022
Clean up pretty path with filepath.Clean
1 parent 4318133 commit 1640e3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎cli/templatecreate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ func createValidTemplateVersion(cmd *cobra.Command, client *codersdk.Client, org
223223

224224
// prettyDirectoryPath returns a prettified path when inside the users
225225
// home directory. Falls back to dir if the users home directory cannot
226-
// discerned.
226+
// discerned. This function calls filepath.Clean on the result.
227227
func prettyDirectoryPath(dir string) string {
228+
dir = filepath.Clean(dir)
228229
homeDir, err := os.UserHomeDir()
229230
if err != nil {
230231
return dir

0 commit comments

Comments
 (0)
Failed to load comments.