Skip to content

Commit

Permalink
Condition simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfiorenzano committed May 12, 2021
1 parent 6daa894 commit 509ba5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tasks/DockerV1/containerbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ export function run(connection: ContainerConnection): any {

var dockerfilepath = tl.getInput("dockerFile", true);
let dockerFile = fileUtils.findDockerFile(dockerfilepath);
if(!tl.exist(dockerFile)) {

if (!tl.exist(dockerFile)) {
throw new Error(tl.loc('ContainerDockerFileNotFound', dockerfilepath));
}

command.arg(["-f", dockerFile]);

var addDefaultLabels = tl.getBoolInput("addDefaultLabels");
if (addDefaultLabels) {
if (addDefaultLabels) {
pipelineUtils.addDefaultLabelArgs(command);
}

var commandArguments = dockerCommandUtils.getCommandArguments(tl.getInput("arguments", false));

command.line(commandArguments);
var imageName = utils.getImageName();

var imageName = utils.getImageName();
var qualifyImageName = tl.getBoolInput("qualifyImageName");
if (qualifyImageName) {
imageName = connection.getQualifiedImageNameIfRequired(imageName);
Expand Down Expand Up @@ -77,7 +77,7 @@ export function run(connection: ContainerConnection): any {
tl.setVariable("DockerOutputPath", taskOutputPath);

const builtImageId = imageUtils.getImageIdFromBuildOutput(output);
if (builtImageId && builtImageId != "") {
if (builtImageId) {
imageUtils.shareBuiltImageId(builtImageId);
}
});
Expand Down

0 comments on commit 509ba5e

Please sign in to comment.