fix: Add override OS and linux default

This commit is contained in:
Tom Hu
2021-08-20 11:23:29 -07:00
parent 53cd6a7259
commit b92422542f
9 changed files with 145 additions and 63 deletions
+6 -15
View File
@@ -2,15 +2,13 @@ import * as fs from 'fs';
import * as https from 'https';
import * as path from 'path';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import buildExec from './buildExec';
import {
BASEURL,
getBaseUrl,
getPlatform,
getUploaderName,
isValidPlatform,
setFailure,
} from './helpers';
@@ -19,18 +17,11 @@ import verify from './validate';
let failCi;
try {
const {execArgs, options, failCi} = buildExec();
const platform = getPlatform();
core.info(`==> ${platform} OS detected`);
const {execArgs, options, failCi, os} = buildExec();
const platform = getPlatform(os);
if (!isValidPlatform()) {
setFailure(
`Codecov: Encountered an unexpected platform: ${platform}`,
failCi,
);
}
const filename = path.join( __dirname, getUploaderName());
https.get(BASEURL, (res) => {
const filename = path.join( __dirname, getUploaderName(platform));
https.get(getBaseUrl(platform), (res) => {
// Image will be stored at this path
const filePath = fs.createWriteStream(filename);
res.pipe(filePath);
@@ -43,7 +34,7 @@ try {
}).on('finish', async () => {
filePath.close();
await verify(filename);
await verify(filename, platform);
await fs.chmodSync(filename, '777');
const unlink = () => {