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

Fix build cmd

parent ddd340ce
...@@ -36,22 +36,34 @@ $( "#generateButton" ).click(function() { ...@@ -36,22 +36,34 @@ $( "#generateButton" ).click(function() {
*/ */
function buildCommand() { function buildCommand() {
var filename = getValue("imageNameInput"); var cmd = "sudo ";
var isSingularity = getChecked("singularityRadio"); var isSingularity = getChecked("singularityRadio");
var filename = getValue("imageNameInput");
if (filename === "") {
if (isSingularity) { if (isSingularity) {
filename = "Singularity"; cmd += "singularity build ";
} else {
filename = "Dockerfile"; if (filename === "") {
cmd += "myimg.sif Singularity";
}
else {
cmd += filename + ".sif " + filename + ".def";
} }
} }
else {
if (isSingularity) { cmd += "docker build ";
alert("sudo singularity build ./" + filename);
} else { if (filename === "") {
alert("sudo docker build ./" + filename); cmd += ".";
}
else {
cmd += "-f " + filename + " .";
}
} }
alert(cmd);
} }
...@@ -68,6 +80,11 @@ function downloadFile() { ...@@ -68,6 +80,11 @@ function downloadFile() {
filename = "Dockerfile"; filename = "Dockerfile";
} }
} }
else {
if (isSingularity) {
filename += ".def";
}
}
var text = getValue("containerPreview"); var text = getValue("containerPreview");
var element = document.createElement('a'); 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