create-payload-app
Advanced tools
Comparing version 0.3.17 to 0.3.18-beta.0
@@ -51,3 +51,3 @@ "use strict"; | ||
var write_common_files_1 = require("./write-common-files"); | ||
function createProjectDir(projectDir) { | ||
function createOrFindProjectDir(projectDir) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -60,10 +60,8 @@ var pathExists; | ||
pathExists = _a.sent(); | ||
if (pathExists) { | ||
(0, log_1.error)("The project directory '".concat(projectDir, "' already exists")); | ||
process.exit(1); | ||
} | ||
if (!!pathExists) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, fs_extra_1.default.mkdir(projectDir)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
_a.label = 3; | ||
case 3: return [2 /*return*/]; | ||
} | ||
@@ -170,3 +168,3 @@ }); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, createProjectDir(projectDir)]; | ||
case 0: return [4 /*yield*/, createOrFindProjectDir(projectDir)]; | ||
case 1: | ||
@@ -173,0 +171,0 @@ _a.sent(); |
@@ -57,3 +57,5 @@ "use strict"; | ||
message: 'Enter MongoDB connection', | ||
initial: "mongodb://localhost/".concat((0, slugify_1.default)(projectName)), | ||
initial: "mongodb://localhost/".concat(projectName === '.' | ||
? "payload-".concat(getRandomDigitSuffix()) | ||
: (0, slugify_1.default)(projectName)), | ||
validate: function (value) { return value.length; }, | ||
@@ -73,1 +75,4 @@ }, { | ||
exports.getDatabaseConnection = getDatabaseConnection; | ||
function getRandomDigitSuffix() { | ||
return (Math.random() * Math.pow(10, 6)).toFixed(0); | ||
} |
@@ -121,3 +121,3 @@ "use strict"; | ||
payloadSecret = _e.sent(); | ||
projectDir = "./".concat((0, slugify_1.default)(projectName)); | ||
projectDir = projectName === '.' ? process.cwd() : "./".concat((0, slugify_1.default)(projectName)); | ||
return [4 /*yield*/, getPackageManager(this.args)]; | ||
@@ -124,0 +124,0 @@ case 12: |
@@ -39,3 +39,3 @@ { | ||
}, | ||
"version": "0.3.17", | ||
"version": "0.3.18-beta.0", | ||
"devDependencies": { | ||
@@ -42,0 +42,0 @@ "@types/command-exists": "^1.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93533
2007