Skip to content

Commit

Permalink
update cli logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Aug 8, 2019
1 parent a42150c commit 5fabdcb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/moon-cli/dist/moon-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
});
res.on("end", function () {
stream.end();
log("download", "template");
log("download", repo);
install(archivePath);
});
}
Expand All @@ -51,7 +51,7 @@
if (err) throw err;
exec("tar -xzf " + archivePath + " -C " + targetPath + " --strip=1", function (err) {
if (err) throw err;
log("install", "template");
log("install", targetPath);
clean(archivePath, targetPath);
});
});
Expand All @@ -60,7 +60,7 @@
function clean(archivePath, targetPath) {
fs.unlink(archivePath, function (err) {
if (err) throw err;
log("clean", "template");
log("clean", archivePath);
create(targetPath, targetPath);
log("success", "Generated project \"" + name + "\"");
console.log("To start, run:\n\tcd " + name + "\n\tnpm install\n\tnpm run dev");
Expand All @@ -83,6 +83,7 @@
}
}

log("Moon", "Generating project");
https.get(archive, function (res) {
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location !== undefined) {
https.get(res.headers.location, function (redirectRes) {
Expand Down
2 changes: 1 addition & 1 deletion packages/moon-cli/dist/moon-cli.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions packages/moon-cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function download(res) {
res.on("end", () => {
stream.end();

log("download", "template");
log("download", repo);
install(archivePath);
});
}
Expand All @@ -45,7 +45,7 @@ function install(archivePath) {
exec(`tar -xzf ${archivePath} -C ${targetPath} --strip=1`, (err) => {
if (err) throw err;

log("install", "template");
log("install", targetPath);
clean(archivePath, targetPath);
});
});
Expand All @@ -55,7 +55,7 @@ function clean(archivePath, targetPath) {
fs.unlink(archivePath, (err) => {
if (err) throw err;

log("clean", "template");
log("clean", archivePath);
create(targetPath, targetPath);
log("success", `Generated project "${name}"`);
console.log(`To start, run:
Expand All @@ -82,6 +82,8 @@ function create(currentPath, targetPath) {
}
}

log("Moon", "Generating project");

https.get(archive, (res) => {
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location !== undefined) {
https.get(res.headers.location, (redirectRes) => {
Expand Down

0 comments on commit 5fabdcb

Please sign in to comment.