Skip to content

Commit

Permalink
feat(#93): determinate target dir correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Nov 30, 2022
1 parent e7870a4 commit e3f8570
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mvnw.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = function(args) {
shell: shell(),
}
);
status.start(args[0]);
status.start(args[0], params.find(element => element.includes("targetDir")).split("=")[1]);
result.on('close', code => {
if (code !== 0) {
throw new Error('The command "' + cmd + '" exited with #' + code + ' code');
Expand Down
8 changes: 6 additions & 2 deletions src/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ module.exports = {

var running = false;
var phase = "unknown";
var beginning;
var target;

function start(stage){
function start(stage, dir){
running = true;
phase = stage;
target = dir;
beginning = Date.now();
var check = function(){
if(running){
print();
Expand All @@ -54,7 +58,7 @@ function stop(){
function print(){
readline.clearLine(process.stdout);
readline.cursorTo(process.stdout, 0);
process.stdout.write("["+phase+"] Total number of compiled files " + count('/Users/lombrozo/Workspace/EOlang/Projects/sum/.eoc', 0));
process.stdout.write("[" +phase + "] Total number of compiled files " + count(target, 0) + ". Stage duration " + (Date.now() - beginning) + " ms");
}

function count(dir, curr){
Expand Down

0 comments on commit e3f8570

Please sign in to comment.