redhat-developer / openshift-vsts

OpenShift Extension for Azure DevOps.
Apache License 2.0
15 stars 20 forks source link

Possible error when using archives with .tar.<extension> #217

Open lstocchi opened 1 year ago

lstocchi commented 1 year ago
          If the value of `archive` is `archiv.tar.bz2`, archiveType would not be correctly set.

I would have suggested to use path.basename instead of replace:

let archiveType = path.extname(archive);
if (path.extname(path.basename(archive)) === '.tar') {
  archiveType = '.tar' + archiveType;
}

_Originally posted by @schurlinga in https://github.com/redhat-developer/openshift-vsts/pull/215#discussion_r1098433414_