create-bridge-app
Advanced tools
Comparing version 1.0.31 to 1.0.32
@@ -20,2 +20,3 @@ #!/usr/bin/env node | ||
const child_process_1 = require("child_process"); | ||
const renameSync_1 = require("./renameSync"); | ||
const launch = () => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -52,33 +53,7 @@ const slugRegex = /^[a-zA-Z0-9-]+$/; | ||
fs_1.default.mkdirSync(projectName); | ||
const oldPath = path_1.default.join(tempRepoPath, `examples/${template}`); | ||
const newPath = projectName; | ||
// const oldPath = path.join(tempRepoPath, `examples/${template}`); | ||
// const newPath = projectName; | ||
// fs.copyFileSync(path.join(tempRepoPath, `examples/${template}`), projectName); | ||
// fs.unlinkSync(`examples/${template}`); | ||
fs_1.default.rename(oldPath, newPath, (err) => { | ||
if (err) { | ||
if (err.code === 'EPERM') { | ||
copy(); | ||
} | ||
else { | ||
console.error(err); | ||
} | ||
return; | ||
} | ||
console.log(`Successfully renamed '${oldPath}' to '${newPath}'`); | ||
}); | ||
function copy() { | ||
const readStream = fs_1.default.createReadStream(oldPath); | ||
const writeStream = fs_1.default.createWriteStream(newPath); | ||
readStream.on('error', console.error); | ||
writeStream.on('error', console.error); | ||
readStream.on('close', () => { | ||
fs_1.default.rmdir(oldPath, (err) => { | ||
if (err) | ||
return console.error(err); | ||
console.log(`Successfully renamed '${oldPath}' to '${newPath}'`); | ||
}); | ||
}); | ||
readStream.pipe(writeStream); | ||
} | ||
// fs.renameSync(path.join(tempRepoPath, `examples/${template}`), projectName); | ||
(0, renameSync_1.renameFolder)(path_1.default.join(tempRepoPath, `examples/${template}`), projectName); | ||
const packageJSONPath = path_1.default.join(projectName, 'package.json'); | ||
@@ -85,0 +60,0 @@ fs_1.default.readFile(packageJSONPath, 'utf-8', (err, data) => { |
{ | ||
"name": "create-bridge-app", | ||
"version": "1.0.31", | ||
"version": "1.0.32", | ||
"description": "Create Bridge-powered Express app with one command", | ||
@@ -5,0 +5,0 @@ "author": "Bridge Team <support@bridge.codes>", |
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
14504
8
280
3