@apso/cli 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/server/new.js +12 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -51,7 +51,18 @@ class New extends base_command_1.default {
|
|
|
51
51
|
fs.mkdirSync(projectPath);
|
|
52
52
|
}
|
|
53
53
|
shelljs_1.default.cd(projectPath);
|
|
54
|
-
|
|
54
|
+
// Execute git clone and capture the result using HTTPS
|
|
55
|
+
const cloneResult = shelljs_1.default.exec(`git clone --depth=1 --branch=main https://github.com/apsoai/service-template.git ${projectPath}`, { silent: true }); // Use silent: true to suppress default output
|
|
56
|
+
// Check if the command failed
|
|
57
|
+
if (cloneResult.code !== 0) {
|
|
58
|
+
// Provide a more generic error message for clone failures
|
|
59
|
+
this.error(`Failed to clone the template repository from GitHub.\n` +
|
|
60
|
+
`Error Output:\n${cloneResult.stderr}\n\n` +
|
|
61
|
+
`Please check your network connection and ensure the repository exists at https://github.com/apsoai/service-template.git\n\n` +
|
|
62
|
+
`If the problem persists, please remove the partially created directory "${projectPath}" and try again.`);
|
|
63
|
+
// Throwing error via this.error will stop execution
|
|
64
|
+
}
|
|
65
|
+
// If clone was successful, proceed to remove the .git directory
|
|
55
66
|
shelljs_1.default.exec(`rm -rf ${projectPath}/.git`);
|
|
56
67
|
shelljs_1.default.cd(this.CURR_DIR);
|
|
57
68
|
}
|
package/oclif.manifest.json
CHANGED