|
|
@@ -152,8 +152,10 @@ export class CreateComponent extends ModalWindow {
|
|
|
var componentName = this.nameField.text;
|
|
|
var outputFile = Atomic.addTrailingSlash(this.resourcePath) + componentName;
|
|
|
|
|
|
- if (outputFile.indexOf(".js") == -1) outputFile += ".js";
|
|
|
-
|
|
|
+ // Check to see if we have a file extension. If we don't then assume .js
|
|
|
+ if (outputFile.indexOf(".") == -1) {
|
|
|
+ outputFile += ".js";
|
|
|
+ }
|
|
|
|
|
|
if (ResourceOps.CreateNewComponent(outputFile, componentName)) {
|
|
|
|
|
|
@@ -205,7 +207,10 @@ export class CreateScript extends ModalWindow {
|
|
|
var scriptName = this.nameField.text;
|
|
|
var outputFile = Atomic.addTrailingSlash(this.resourcePath) + scriptName;
|
|
|
|
|
|
- if (outputFile.indexOf(".js") == -1) outputFile += ".js";
|
|
|
+ // Check to see if we have a file extension. If we don't then assume .js
|
|
|
+ if (outputFile.indexOf(".") == -1) {
|
|
|
+ outputFile += ".js";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (ResourceOps.CreateNewScript(outputFile, scriptName)) {
|