mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Format files according to Prettier rules and build
This commit is contained in:
parent
25a133c257
commit
53f5d5ec02
7 changed files with 120128 additions and 6377 deletions
58877
dist/cache-save/index.js
vendored
Normal file
58877
dist/cache-save/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6359
dist/index.js
vendored
6359
dist/index.js
vendored
File diff suppressed because it is too large
Load diff
61239
dist/setup/index.js
vendored
Normal file
61239
dist/setup/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -18,9 +18,7 @@ export const restoreCache = async (
|
||||||
const packageManagerInfo = await getPackageManagerInfo();
|
const packageManagerInfo = await getPackageManagerInfo();
|
||||||
const platform = process.env.RUNNER_OS;
|
const platform = process.env.RUNNER_OS;
|
||||||
|
|
||||||
const cachePath = await getCacheDirectoryPath(
|
const cachePath = await getCacheDirectoryPath(packageManagerInfo);
|
||||||
packageManagerInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
const goSumFilePath = cacheDependencyPath
|
const goSumFilePath = cacheDependencyPath
|
||||||
? cacheDependencyPath
|
? cacheDependencyPath
|
||||||
|
|
|
@ -26,9 +26,7 @@ const cachePackages = async () => {
|
||||||
|
|
||||||
const packageManagerInfo = await getPackageManagerInfo();
|
const packageManagerInfo = await getPackageManagerInfo();
|
||||||
|
|
||||||
const cachePath = await getCacheDirectoryPath(
|
const cachePath = await getCacheDirectoryPath(packageManagerInfo);
|
||||||
packageManagerInfo,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!fs.existsSync(cachePath)) {
|
if (!fs.existsSync(cachePath)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
@ -8,7 +8,7 @@ export interface PackageManagerInfo {
|
||||||
|
|
||||||
export const defaultPackageManager: PackageManagerInfo = {
|
export const defaultPackageManager: PackageManagerInfo = {
|
||||||
goSumFilePattern: 'go.sum',
|
goSumFilePattern: 'go.sum',
|
||||||
getCacheFolderCommand: 'go env GOMODCACHE',
|
getCacheFolderCommand: 'go env GOMODCACHE'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCommandOutput = async (toolCommand: string) => {
|
export const getCommandOutput = async (toolCommand: string) => {
|
||||||
|
@ -29,13 +29,11 @@ export const getCommandOutput = async (toolCommand: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPackageManagerInfo = async () => {
|
export const getPackageManagerInfo = async () => {
|
||||||
|
|
||||||
return defaultPackageManager;
|
return defaultPackageManager;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCacheDirectoryPath = async (
|
export const getCacheDirectoryPath = async (
|
||||||
packageManagerInfo: PackageManagerInfo,
|
packageManagerInfo: PackageManagerInfo
|
||||||
) => {
|
) => {
|
||||||
const stdout = await getCommandOutput(
|
const stdout = await getCommandOutput(
|
||||||
packageManagerInfo.getCacheFolderCommand
|
packageManagerInfo.getCacheFolderCommand
|
||||||
|
|
Loading…
Add table
Reference in a new issue