[CB-3495] clean project after creating
diff --git a/bin/create.js b/bin/create.js
index d5e7c46..c4c789e 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -210,6 +210,9 @@
}
}
+ //clean up any Bin/obj or other generated files
+ exec('cscript ' + path + '\\cordova\\lib\\clean.js //nologo');
+
Log("CREATE SUCCESS : " + path);
// TODO: Name the project according to the arguments
diff --git a/templates/standalone/cordova/lib/clean.js b/templates/standalone/cordova/lib/clean.js
index caa1957..b091425 100644
--- a/templates/standalone/cordova/lib/clean.js
+++ b/templates/standalone/cordova/lib/clean.js
@@ -52,14 +52,20 @@
function clean_project(path) {
delete_if_exists(path + "\\obj");
delete_if_exists(path + "\\Bin");
- // delete AppName.csproj.user as well? Service References?
- var proj_folder = fso.GetFolder(path);
- var proj_files = new Enumerator(proj_folder.Files);
- for (;!proj_files.atEnd(); proj_files.moveNext()) {
- if (fso.GetExtensionName(proj_files.item()).match(/user/)) {
- fso.DeleteFile(proj_files.item());
+
+ // checks to see if a .csproj file exists in the project root
+ if (fso.FolderExists(path)) {
+ var proj_folder = fso.GetFolder(path);
+ var proj_files = new Enumerator(proj_folder.Files);
+ for (;!proj_files.atEnd(); proj_files.moveNext()) {
+ if (fso.GetExtensionName(proj_files.item()) == 'user') {
+ delete_if_exists(proj_files.item())
+ } else if (fso.GetExtensionName(proj_files.item()) == 'sou') {
+ delete_if_exists(proj_files.item())
+ }
}
}
+ //TODO: delete Service References?
}
// cleans any files generated by build --debug