Commit 1782b134 authored by jlopez's avatar jlopez
Browse files

Fix build cmd

parent ddd340ce
......@@ -36,22 +36,34 @@ $( "#generateButton" ).click(function() {
*/
function buildCommand() {
var filename = getValue("imageNameInput");
var cmd = "sudo ";
var isSingularity = getChecked("singularityRadio");
var filename = getValue("imageNameInput");
if (filename === "") {
if (isSingularity) {
filename = "Singularity";
} else {
filename = "Dockerfile";
cmd += "singularity build ";
if (filename === "") {
cmd += "myimg.sif Singularity";
}
else {
cmd += filename + ".sif " + filename + ".def";
}
}
else {
if (isSingularity) {
alert("sudo singularity build ./" + filename);
} else {
alert("sudo docker build ./" + filename);
cmd += "docker build ";
if (filename === "") {
cmd += ".";
}
else {
cmd += "-f " + filename + " .";
}
}
alert(cmd);
}
......@@ -68,6 +80,11 @@ function downloadFile() {
filename = "Dockerfile";
}
}
else {
if (isSingularity) {
filename += ".def";
}
}
var text = getValue("containerPreview");
var element = document.createElement('a');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment