Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[CB-4343] Remove parsing of project name from create script.
BAR file is now a constant and this value is unused.
The validation logic caused issues in CLI with spaces/special characters.
  • Loading branch information
bryanhiggins committed Aug 13, 2013
1 parent 9bf2a4c commit ed53b6c47ee62f7f2321553929a1fe085ddcdae4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
@@ -32,7 +32,6 @@ var build,
version = getVersion(),
project_path = validateProjectPath(),
app_id = process.argv[3],
bar_name = process.argv[4],
TARGETS = ["device", "simulator"],
TEMPLATE_PROJECT_DIR = path.join(__dirname, "templates", "project"),
MODULES_PROJECT_DIR = path.join(__dirname, "..", "node_modules"),
@@ -63,11 +62,6 @@ function validPackageName(packageName) {
return true;
}

function validBarName(barName) {
var barNameRegex = /^[a-zA-Z0-9._\-]+$/;
return (typeof barName === "undefined") || barNameRegex.test(barName);
}

function validateProjectPath() {
if (!process.argv[2]) {
console.log("You must give a project PATH");
@@ -89,11 +83,6 @@ function validate() {
console.log("[warning] App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters.\n" +
"special characters in '" + app_id + "' will be replaced by '_'");
}
if (!validBarName(bar_name)) {
console.log("BAR filename can only contain alpha-numeric, '.', '-' and '_' characters");
help();
process.exit(2);
}
}

function clean() {
@@ -203,7 +192,7 @@ function updateProject() {
}

function help() {
console.log("\nUsage: create <project path> [package name [BAR filename]] \n");
console.log("\nUsage: create <project path> [package name] \n");
console.log("Options: \n");
console.log(" -h, --help output usage information \n");
}
@@ -100,8 +100,4 @@ describe("create tests", function () {
expect(_output).toContain("App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters");
});

it("Invalid barName error", function () {
executeScript(CREATE_COMMAND, [appFolder, "com.example.app", "%bad@bar^name"], true);
expect(_output).toContain("BAR filename can only contain alpha-numeric, '.', '-' and '_' characters");
});
});

0 comments on commit ed53b6c

Please sign in to comment.