@@ -90,9 +90,10 @@ EXAMPLES
9090 cmd .Flags ().StringP ("repository" , "r" , "" , "URI to a Git repository containing the specified template ($FUNC_REPOSITORY)" )
9191
9292 addConfirmFlag (cmd , cfg .Confirm )
93- // Add --path flag (default ".") for consistency with other commands.
94- // Retain positional [path] for backward compatibility (warned later).
95- cmd .Flags ().StringP ("path" , "p" , "." , "Path to the function project directory ($FUNC_PATH)" )
93+ // Add --path flag (default "") for consistency with other commands.
94+ // Retain positional [path] for backward compatibility.
95+ // Empty string default means current directory.
96+ cmd .Flags ().StringP ("path" , "p" , "" , "Path to the function project directory ($FUNC_PATH)" )
9697
9798 addVerboseFlag (cmd , cfg .Verbose )
9899
@@ -183,11 +184,24 @@ func newCreateConfig(cmd *cobra.Command, args []string, newClient ClientFactory)
183184
184185 pathFlag = viper .GetString ("path" )
185186
186- finalPath := "."
187+ // Default to empty string which deriveNameAndAbsolutePathFromPath
188+ // interprets as current working directory
189+ finalPath := ""
190+
191+ // Use --path flag if provided (takes precedence)
187192 if pathFlag != "" && pathFlag != "." {
188193 finalPath = pathFlag
194+ } else if pathFlag == "." {
195+ // Convert shell convention "." to empty string for internal use
196+ finalPath = ""
189197 } else if len (args ) >= 1 && args [0 ] != "" {
190- finalPath = args [0 ]
198+ // Fall back to positional argument if no --path flag
199+ if args [0 ] == "." {
200+ // Convert shell convention "." to empty string
201+ finalPath = ""
202+ } else {
203+ finalPath = args [0 ]
204+ }
191205 }
192206
193207 dirName , absolutePath = deriveNameAndAbsolutePathFromPath (finalPath )
0 commit comments