Fix Dockerfile command view for FROM with as clause

This commit is contained in:
Joseph Schorr 2017-06-23 16:04:05 -04:00
parent 09e9b5cb53
commit e0a1e05c52
2 changed files with 9 additions and 3 deletions

View file

@ -44,13 +44,14 @@ export class DockerfileCommandComponent {
var kindHandlers = {
'FROM': (command) => {
var pieces = command.split('/');
var parts = command.split(' ');
var pieces = parts[0].split('/');
var registry = pieces.length < 3 ? '' : pieces[0];
if (!this.registryHandlers[registry]) {
return command;
}
return '<i class="fa fa-hdd-o"></i> <a href="' + this.registryHandlers[registry](pieces) + '" target="_blank">' + command + '</a>';
return '<a href="' + this.registryHandlers[registry](pieces) + '" target="_blank">' + parts[0] + '</a> ' + (parts.splice(1).join(' '));
}
};