Skip to content

Commit 065260a

Browse files
committed
Removed useless lines in .sh script when some fields of GUI are empty
1 parent a4f763f commit 065260a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

js/make.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,16 +465,20 @@ function makeScript(lab){
465465
text += 'cd "$(dirname "$0")/lab"\n';
466466
text += "\n";
467467
for(var folderName in lab["folder"]){
468-
text += "mkdir -p " + folderName + "\n";
468+
if(folderName!=""){
469+
text += "mkdir -p " + folderName + "\n";
470+
}
469471
}
470472
for(var fileName in lab["file"]){
471473
text += "touch " + fileName + "\n";
472474
var lines = lab["file"][fileName].split("\n");
473475
for(var lineIndex in lines) {
474-
text += "echo '" + lines[lineIndex] + "' >> " + fileName + "\n";
476+
if(lines[lineIndex] != ""){
477+
text += "echo '" + lines[lineIndex] + "' >> " + fileName + "\n";
478+
}
475479
}
476480
}
477-
text += "rm \"$0\"\n";
481+
text += "rm \"../$0\"\n";
478482

479483
return text;
480484
}

0 commit comments

Comments
 (0)