Bump typescript, fix build errors around catch blocks.

This commit is contained in:
Nick Cipollo
2021-10-03 17:21:27 -04:00
parent 4531373c80
commit 821cbcc349
6 changed files with 8 additions and 8 deletions

View File

@@ -6,14 +6,14 @@ const fs_1 = require("fs");
class Artifact {
constructor(path, contentType = "raw") {
this.path = path;
this.name = path_1.basename(path);
this.name = (0, path_1.basename)(path);
this.contentType = contentType;
}
get contentLength() {
return fs_1.statSync(this.path).size;
return (0, fs_1.statSync)(this.path).size;
}
readFile() {
return fs_1.readFileSync(this.path);
return (0, fs_1.readFileSync)(this.path);
}
}
exports.Artifact = Artifact;

View File

@@ -63,7 +63,7 @@ class FileArtifactGlobber {
throw Error(`Artifact pattern :${pattern} did not match any files`);
}
static expandPath(path) {
return untildify_1.default(path);
return (0, untildify_1.default)(path);
}
}
exports.FileArtifactGlobber = FileArtifactGlobber;

View File

@@ -39,7 +39,7 @@ class ArtifactPathValidator {
}
}
verifyNotDirectory(path) {
const isDir = fs_1.statSync(path).isDirectory();
const isDir = (0, fs_1.statSync)(path).isDirectory();
if (isDir) {
const message = `Artifact is a directory:${path}. Directories can not be uploaded to a release.`;
this.reportError(message);

View File

@@ -164,7 +164,7 @@ class CoreInputs {
return core.getInput('omitNameDuringUpdate') == 'true';
}
stringFromFile(path) {
return fs_1.readFileSync(path, 'utf-8');
return (0, fs_1.readFileSync)(path, 'utf-8');
}
}
exports.CoreInputs = CoreInputs;

View File

@@ -42,7 +42,7 @@ export class Action {
let getResponse: ReleaseByTagResponse
try {
getResponse = await this.releases.getByTag(this.inputs.tag)
} catch (error) {
} catch (error: any) {
return await this.checkForMissingReleaseError(error)
}

View File

@@ -41,7 +41,7 @@ export class GithubArtifactUploader implements ArtifactUploader {
artifact.readFile(),
artifact.name,
releaseId)
} catch (error) {
} catch (error: any) {
if (error.status >= 500 && retry > 0) {
core.warning(`Failed to upload artifact ${artifact.name}. ${error.message}. Retrying...`)
await this.uploadArtifact(artifact, releaseId, uploadUrl, retry - 1)