File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,18 @@ public CSTOJS(CSTOJSOptions options)
7272 /// Method for generating js file.
7373 /// </summary>
7474 /// <param name="path">Full path to cs file.</param>
75- /// <param name="filename">Filename of a js file. Default: <c>main.js</c> </param>
75+ /// <param name="filename">Filename of a js file.</param>
7676 /// <returns></returns>
77- public async Task GenerateOneAsync ( string path , string filename = "main.js" )
77+ public async Task GenerateOneAsync ( string path , string ? filename = null )
7878 {
7979 Assembly assembly = Assembly . GetEntryAssembly ( ) ;
8080
81- await GenerateAsync ( path , assembly , filename ) ;
81+ FileInfo file = new ( path ) ;
82+
83+ if ( filename != null )
84+ await GenerateAsync ( path , assembly , filename ) ;
85+ else
86+ await GenerateAsync ( path , assembly , file . Name . Replace ( ".cs" , ".js" ) ) ;
8287 }
8388 /// <summary>
8489 /// Method for generating multiply js files.
You can’t perform that action at this time.
0 commit comments