File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as core from '@actions/core' ;
22import * as cache from '@actions/cache' ;
3+ import fs from 'fs' ;
34import { State } from './constants' ;
45import { getCacheDirectoryPath , getPackageManagerInfo } from './cache-utils' ;
56
@@ -26,6 +27,13 @@ const cachePackages = async (packageManager: string) => {
2627 packageManagerInfo ,
2728 packageManager
2829 ) ;
30+
31+ if ( ! fs . existsSync ( cachePath ) ) {
32+ throw new Error (
33+ `Cache folder path is retrieved for ${ packageManager } but doesn't exist on disk: ${ cachePath } `
34+ ) ;
35+ }
36+
2937 if ( primaryKey === state ) {
3038 core . info (
3139 `Cache hit occurred on the primary key ${ primaryKey } , not saving cache.`
Original file line number Diff line number Diff line change 11import * as core from '@actions/core' ;
22import * as exec from '@actions/exec' ;
3- import fs from 'fs' ;
43import os from 'os' ;
54import path from 'path' ;
65
@@ -98,11 +97,5 @@ export const getCacheDirectoryPath = async (
9897
9998 core . debug ( `${ packageManager } path is ${ stdOut } ` ) ;
10099
101- if ( ! fs . existsSync ( stdOut ) ) {
102- throw new Error (
103- `Cache folder path is retrieved for ${ packageManager } but doesn't exist on disk: ${ stdOut } `
104- ) ;
105- }
106-
107100 return stdOut ;
108101} ;
You can’t perform that action at this time.
0 commit comments