Skip to content

Commit

Permalink
compile created files
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jul 17, 2018
1 parent a206f79 commit 2868428
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/moon-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const archive = {
}
};

const MoonNameRE = /{# MoonName #}/g;

const log = (type, message) => {
console.log(`\x1b[34m${type}\x1b[0m ${message}`);
};
Expand Down Expand Up @@ -68,6 +70,7 @@ const create = (currentPath, targetPath) => {
if (fs.statSync(nextPath).isDirectory()) {
create(nextPath, targetPath);
} else {
fs.writeFileSync(nextPath, fs.readFileSync(nextPath).toString().replace(MoonNameRE, name));
log("create", path.relative(targetPath, nextPath));
}
}
Expand Down

0 comments on commit 2868428

Please sign in to comment.