Browse Source

Make sure we add the extension, even if there is more than one dot.

Shaddock Heath 8 years ago
parent
commit
0d2f9c318d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Script/AtomicEditor/ui/modal/UIResourceOps.ts

+ 1 - 1
Script/AtomicEditor/ui/modal/UIResourceOps.ts

@@ -264,7 +264,7 @@ export class CreateScript extends ModalWindow {
 
 
                 if (selectedTemplate) {
                 if (selectedTemplate) {
                     // Check to see if we have a file extension.  If we don't then use the one defined in the template
                     // Check to see if we have a file extension.  If we don't then use the one defined in the template
-                    if (outputFile.indexOf(".") == -1) {
+                    if (outputFile.lastIndexOf(`.${selectedTemplate.ext}`) != outputFile.length - selectedTemplate.ext.length) {
                         outputFile += selectedTemplate.ext;
                         outputFile += selectedTemplate.ext;
                     }
                     }